[Dnsmasq-discuss] domain search and dnsmasq

Gerrit Kühn gerrit at pmp.uni-hannover.de
Mon Jun 2 15:40:35 BST 2008

Hi folks,

I have a question regarding domain searching and dnsmasq. I have dnsmasq
doing dhcp and dns services for my NATed local subnet 192.168.64./24 which
has the domain name psl-rt.aei.uni-hannover.de. I would like to be able to
resolve hosts in our "real world" subnet 130.75.117/24 with the domain
names aei.uni-hannover and in the local subnet with by their hostname
(without aei.uni-hannover.de viz. psl-rt.aei.uni-hannover.de).
Between these two nets there is another private subnet 10.117.15/24 with
the domain name rt.aei.uni-hannover.de. It would be nice to access this
hosts by hostname alone, too.

Hostname-lookup works easily inside the 192. subnet. However, I did not
find a possibility for resolving just the hostnames from the real world
net, although I tried a lot of combinations in resolv.conf, dnsmasq.conf
and so on.

What I have right now is the following: (firefly1) is working as NAT-router and dnsmasq-server
(NAT interface is

firefly1# cat /etc/resolv.conf
domain aei.uni-hannover.de
search aei.uni-hannover.de rt-psl.aei.uni-hannover.de

firefly1# cat /etc/myresolv.conf
domain  rt.aei.uni-hannover.de

myresolv.conf is used by dnsmasq via resolv-file, expand-hosts is active
and domain is set to rt-psl.aei.uni-hannover.de. This way
is able to resolve everything just by hostname:

to rt-psl.uaei.uni-hannover.de
firefly1# ping psl-ws1
PING psl-ws1.rt-psl.aei.uni-hannover.de ( 56 data bytes

to rt.aei.uni-hannover.de
firefly1# ping mclane
PING mclane.aei.uni-hannover.de ( 56 data bytes

to aei.uni-hannover.de
firefly1# ping arc
PING arc.aei.uni-hannover.de ( 56 data bytes

However, a host in the 192. subnet can only resolve in this subnet, but
not in the others:

[root at psl-ws1 ~]# ping psl-ws2
PING psl-ws2.rt-psl.aei.uni-hannover.de ( 56(84) bytes of

[root at psl-ws1 ~]# ping firefly1
ping: unknown host firefly1

[root at psl-ws1 ~]# ping mclane
ping: unknown host mclane

[root at psl-ws1 ~]# ping arc
ping: unknown host arc

In all these cases, fully qualified domain names do work. Even nslookup
works with the hostnames alone:

[root at psl-ws1 ~]# nslookup firefly1

Name:   firefly1

[root at psl-ws1 ~]# nslookup mclane

Name:   mclane

[root at psl-ws1 ~]# nslookup arc

Name:   arc

Why does ping resolve differently from nslookup?
Can anyone here explain to me how to setup dnsmasq in a way that the
machines in the 192. subnet are able to resolve the hostnames of all other


More information about the Dnsmasq-discuss mailing list