[Dnsmasq-discuss] Wrong hostname in DHCP answer if FQDN in /etc/hosts

Simon Kelley simon at thekelleys.org.uk
Tue May 8 08:00:30 BST 2007


Michael Heimpold wrote:
> Hi,
> 
> I just played around with automatic debian installation and wondered
> why the (simple) hostname was set to the FQDN. I checked with
> tcpdump and found that the hostname field in the DHCP answer packet
> from dnsmasq already contains the FQDN. After some searching I tracked
> the problem down to my /etc/hosts file, which I filled with FQDNs
> (because I think this is the correct way of defining entries in this file):
> -snip-
> 192.168.0.253   debian.heimpold.lan. debian
> -snap-
> 
> Now I wonder if I configured anything wrong or if dnsmasq processes
> this file incorrectly (I assume that the hostname must not include any dot
> by definition - is this assumption correct?)?
> 
> I temporary solved this by dropping the FQDNs from /etc/hosts and
> adding 'expand-hosts' to my dnsmasq config. 'domain' was already set ue 
> before.
> 

Which version of dnsmasq are you using? A quick look at the current code 
seems to show that it will strip the domain part (.heimpold.lan) from 
the DNS name and just send the name, as long as the domain part matches 
the domain set in the configuration. If the domain doesn't match, it 
will complain and send nothing.

That seems to me to be the correct behaviour, but not what you are 
seeing. I have a vague memory that this code changed in the past, but I 
can't find when, with a quick scan of the changelog.

Cheers,

Simon.




More information about the Dnsmasq-discuss mailing list