associate dhcp requests with subdomains in dnsmasq

Posted by Dezra on Server Fault See other posts from Server Fault or by Dezra
Published on 2010-05-12T17:54:43Z Indexed on 2010/05/12 18:05 UTC
Read the original article Hit count: 336

Filed under:
|
|
|

I have dnsmasq running as a dns server with a number of linux boxes using static ips that run several virtual hosts on subdomains.

I currently have the following address line in my dnsmasq.conf to map the subdomain of a boxes address to the boxes static ip:

address=/.devbox1.mydomain.com/192.168.1.3
address=/.devbox2.mydomain.com/192.168.1.4

e.g.

site1.devbox1.mydomain.com > maps to devbox1 static ip, site1 virtual host
site2.devbox1.mydomain.com > maps to devbox1 static ip, site2 virtual host
site3.devbox2.mydomain.com > maps to devbox2 static ip, site3 virtual host

I was wondering if I can change the machines over to DHCP addresses (instead of static) and have dnsmasq use the dhcp ip instead of the static one?

Can I modify the address line to refer to the DHCP address (obviously, I cant hardcode the address)?

I know I could add mac address to ip allocation, but I want to avoid this if possible.

© Server Fault or respective owner

Related posts about dnsmasq

Related posts about dhcp