Discussion:
[Dnsmasq-discuss] keep FQDN for DHCP lookups?
Bernd Helm
2017-11-16 18:17:42 UTC
Permalink
Im using LXC with a custom config:

dhcp-hostsfile=/etc/lxc/dnsmasq-hosts.conf

and that dnsmasq-hosts.com file contains hosts like:

staging.wip.mydomain.com,192.168.34.11
staging.rog.mydomain.com,192.168.34.21

problem is, that both hosts get the same ip, because dnsmasq reduces the
client's hostname just to "staging".

The log reads "Ignoring domain wip.mydomain.com for DHCP host name staging"

i use FQDN's that are public resolveable to assign local IPS to the vms
(on a bridge interface, i forward traffic using haproxy).

is there a way to tell dnsmasq to NOT remove the domain part when
searching the dhcp-hostsfile and saving leases?

Thank you.

Below the full log:

***@vps464623:/etc/lxc# dnsmasq -d --conf-file=/etc/lxc/dnsmasq.conf -u
dnsmasq --strict-order --bind-interfaces --pid-file=/run/lxc/dnsmasq.pid
--listen-address 192.168.34.1 --dhcp-range 192.168.34.10,192.168.34.254
--dhcp-lease-max=253 --dhcp-dnsmasq: started, version 2.76 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6
no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
dnsmasq-dhcp: DHCP, IP range 192.168.34.10 -- 192.168.34.254, lease time 1h
dnsmasq-dhcp: DHCP, sockets bound exclusively to interface lxcbr0
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 213.186.33.99#53
dnsmasq: read /etc/hosts - 8 addresses
dnsmasq-dhcp: read /etc/lxc/dnsmasq-hosts.conf
dnsmasq-dhcp: 980578109 available DHCP range: 192.168.34.10 --
192.168.34.254
dnsmasq-dhcp: 980578109 client provides name: staging.rog.mydomain.com
dnsmasq-dhcp: 980578109 DHCPREQUEST(lxcbr0) 192.168.34.21 00:16:3e:46:b4:2b
dnsmasq-dhcp: 980578109 tags: known, lxcbr0
dnsmasq-dhcp: Ignoring domain rog.mydomain.com for DHCP host name staging
dnsmasq-dhcp: 980578109 DHCPACK(lxcbr0) 192.168.34.21 00:16:3e:46:b4:2b
staging
dnsmasq-dhcp: 980578109 requested options: 1:netmask, 28:broadcast,
2:time-offset, 3:router,
dnsmasq-dhcp: 980578109 requested options: 15:domain-name, 6:dns-server,
119:domain-search,
dnsmasq-dhcp: 980578109 requested options: 12:hostname, 44:netbios-ns,
47:netbios-scope,
dnsmasq-dhcp: 980578109 requested options: 26:mtu,
121:classless-static-route, 42:ntp-server
dnsmasq-dhcp: 980578109 next server: 192.168.34.1
dnsmasq-dhcp: 980578109 sent size:  1 option: 53 message-type  5
dnsmasq-dhcp: 980578109 sent size:  4 option: 54 server-identifier 
192.168.34.1
dnsmasq-dhcp: 980578109 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 980578109 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 980578109 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 980578109 sent size:  4 option:  1 netmask 255.255.255.0
dnsmasq-dhcp: 980578109 sent size:  4 option: 28 broadcast 192.168.34.255
dnsmasq-dhcp: 980578109 sent size:  4 option:  3 router 192.168.34.1
dnsmasq-dhcp: 980578109 sent size:  4 option:  6 dns-server 192.168.34.1
dnsmasq-dhcp: 980578109 sent size:  7 option: 12 hostname  staging
Loading...