[Dnsmasq-discuss] Can't set FQDN on dhcp clients

Simon Kelley simon at thekelleys.org.uk
Fri Jun 8 21:32:30 BST 2012


On 08/06/12 20:25, Snyder, Chris wrote:
>
>
> -----Original Message-----
> From: dnsmasq-discuss-bounces at lists.thekelleys.org.uk
> [mailto:dnsmasq-discuss-bounces at lists.thekelleys.org.uk] On Behalf Of
> Simon Kelley
> Sent: Friday, June 08, 2012 2:34 PM
> To: dnsmasq-discuss at lists.thekelleys.org.uk
> Subject: Re: [Dnsmasq-discuss] Can't set FQDN on dhcp clients
>
> That config should be enough. Are you sure that your DHCP is asking for
> the domain name or FQDN option and using the result?
>
> Add
>
> log-dhcp
>
> to your dhcp configuration, cycle a client and take a look the logs to
> see what's going on.
>
> Simon.
> ------------
>
> I added the 'log-dhcp' and reran my tests.  'hostname' on client still
> returns only 'test2'.  (Client is RH5, btw.)
>
> What I'm confused about is that I have the mac correct for my client in
> /etc/ethers, 00:0c:29:72:50:92.  But the only time it seems to match
> that mac is if I have the short name in both /etc/ethers and /etc/hosts.
> Seems anytime I put a full FQDN in /etc/hosts or /etc/ethers for a given
> client, it no longer matches the mac. For example, in cases where the
> mac matches, dnsmasq assigns 192.168.56.5, which is desired behavior.

The domain part has to match the domain given in the --domain option. In 
general dnsmasq doesn't handle arbitrary domains - it's designed to be 
used with a single domain, but there are some extensions.


>
> In the log output, it is returning the 'test2' for the dhcp-option
> 'hostname' and 'gopher.sra.com' for the dhcp-option 'domain-name'.
> Personally, I would have expected it to return the FQDN for hostname.
>

Why?  That arrangement seems to work with clients that don't support the 
FQDN option.


Simon.

> Logs below:
>
> Jun  8 14:23:02 kei dnsmasq[7712]: DHCP packet: transaction-id is
> 1773225885
> Jun  8 14:23:02 kei dnsmasq[7712]: Available DHCP range: 192.168.56.128
> -- 192.168.56.235
> Jun  8 14:23:02 kei dnsmasq[7712]: DHCPREQUEST(eth0) 192.168.56.173
> 00:0c:29:72:50:92
> Jun  8 14:23:02 kei dnsmasq[7712]: DHCPACK(eth0) 192.168.56.173
> 00:0c:29:72:50:92 test2
> Jun  8 14:23:02 kei dnsmasq[7712]: requested options: 1:netmask,
> 28:broadcast, 2:time-offset, 3:router,
> Jun  8 14:23:02 kei dnsmasq[7712]: requested options: 15:domain-name,
> 6:dns-server, 12:hostname,
> Jun  8 14:23:02 kei dnsmasq[7712]: requested options: 40:nis-domain,
> 41:nis-server, 42:ntp-server,
> Jun  8 14:23:02 kei dnsmasq[7712]: requested options: 26:mtu
> Jun  8 14:23:02 kei dnsmasq[7712]: tags: known
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  1 option: 53:message-type
> 05
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option:
> 54:server-identifier  c0:a8:38:02
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option: 51:lease-time
> 00:00:a8:c0
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option: 58:T1
> 00:00:54:60
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option: 59:T2
> 00:00:93:a8
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option:  1:netmask
> ff:ff:ff:00
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option: 28:broadcast
> c0:a8:38:ff
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option:  6:dns-server
> c0:a8:38:02
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size: 14 option: 15:domain-name
> 67:6f:70:68:65:72:2e:73:72:61:2e:63:6f...
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  5 option: 12:hostname
> 74:65:73:74:32
> Jun  8 14:23:02 kei dnsmasq[7712]: sent size:  4 option:  3:router
> c0:a8:38:01
> Jun  8 14:23:02 kei dnsmasq[7712]: not giving name test2.gopher.sra.com
> to the DHCP lease of 192.168.56.173 because the name exists in
> /etc/hosts with address 192.168.56.5
>




More information about the Dnsmasq-discuss mailing list