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

Simon Kelley simon at thekelleys.org.uk
Fri Jun 8 19:34:21 BST 2012


On 08/06/12 19:27, Snyder, Chris wrote:
> I’m hope what I want is possible with dnsmasq, but if it is I’m out of
> ideas. Would love some help.
>
> What I want is my dhcp clients to:
>
> A)get assigned an IP via DHCP from MAC matching on the dnsmasq server
> (using /etc/ethers + /etc/hosts)
>
> B)have forward/reverse DNS on my local network (via dnsmasq)
>
> C)have a full FQDN via ‘hostname’ command
>
> I’ve got A + B working now. Nothing I seem to do will give me an FQDN on
> my clients, ‘hostname’ only returns the node name rather than the FQDN.
> This breaks a lot of software that is expecting and FQDN from that. If I
> can’t get FQDN via DHCP then I’m going to have to ditch dnsmasq and go
> for statically assigned IPs and break out Bind which I don’t want to do
> as this is a dynamic test network that will change a lot.
>
> My target client should be assigned an IP of 192.168.56.5 and a name of
> ‘test2.example.com’, all by dnsmasq. With my current setup , it does get
> .5 and does get ‘test2’. But if I try setting an FQDN in either
> /etc/hosts or /etc/ethers dnsmaq doesn’t seem to like that, the MAC
> matching appears to break, doesn’t give me .5 and it yells at me with
> the following:
>
> not giving name test2.example.com to the DHCP lease of 192.168.56.173
> because the name exists in /etc/hosts with address 192.168.56.5
>
> I’ve tried every combination of FQDN and short name within /etc/ethers
> and /etc/hosts I can think of, but nothing works. I’ve seen references
> to using dhcp-host lines in my dnsmasq.conf file, but that is not a
> desired solution for me at this time. (But if that’s all that works..
> .oh well).
>
> Any ideas? Thanks
>
> Chris.
>
> Currently using dnsmasq v2.45 (via Red Hat rpm)
>
> My /etc/dnsmasq.conf (which runs on 192.168.56.2):
>
> log-dhcp
>
> bogus-priv
>
> dhcp-authoritative
>
> dhcp-option=option:router,192.168.56.1
>
> dhcp-range=192.168.56.128,192.168.56.235,12h
>
> domain-needed
>
> domain=example.com
>
> expand-hosts
>
> local=/example.com/
>
> read-ethers
>
> My /etc/ethers:
>
> 00:0c:29:72:50:92 test2
>
> My /etc/hosts:
>
> 127.0.0.1 localhost.localdomain localhost
>
> 192.168.56.5 test2
>

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.




More information about the Dnsmasq-discuss mailing list