Contents
Is the Dnsmasq DHCP not giving IP address?
I understand that this is most likely a dead post, but I stumbled upon it while looking for an answer to my issue and noticed the following straight off…
What’s the problem with Dnsmasq on a VM?
Basically my situation is that I’m running a VM for developing web sites. The host machine has its dns pointing at the VM which, is running dnsmasq, which resolves the addresses of various dev sites; i.e. test.mysite.vm, etc. The issue is, when I go from my work network to my home network, it all breaks because the IP of the VM changes.
Can a DNS query return only one address?
Return answers to DNS queries from /etc/hosts which depend on the interface over which the query was received. If a name in /etc/hosts has more than one address associated with it, and at least one of those addresses is on the same subnet as the interface to which the query was sent, then return only the address (es) on that subnet.
What does it mean when a server has multiple IP addresses?
This allows for a server to have multiple addresses in /etc/hosts corresponding to each of its interfaces, and hosts will get the correct address based on which network they are attached to. Currently this facility is limited to IPv4.
How to define static ranges in dnsmasq.conf?
There is no need to explicitly define static ranges in your dnsmasq.conf if they belong to a subnet defined in dhcp-range: simply define static leases using dhcp-host (e.g., dhcp-host= [MAC address], [IP address].
When do you need a static range for DHCP?
Defining static ranges is only needed if you want to assign static IP addresses in a subnet where you do not also assign dynamic IP addresses. Addresses allocated like this [i.e., using dhcp-host] are not constrained to be in the range given by the –dhcp-range option, but they must be in the same subnet as some valid dhcp-range.
What should DHCP-range = 192.168.1.20 be?
All you should need is a single dhcp-range=192.168.1.2,192.168.1.20,12h line for the range. dnsmasq has a lot of additional options ranges for conditional ranges, but for a simple scenario like you’ve described, the single line should suffice. If you’re just appending lines to /etc/dnsmasq.conf, make sure there aren’t spurious entries above.