Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dnsmasq issues -- not resolving all hostnames
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Tue Apr 09, 2013 8:54 pm    Post subject: dnsmasq issues -- not resolving all hostnames Reply with quote

Hi guys,

I set-up dnsmasq on a Gentoo VM for a small network in our office.
It is serving as DHCP server and (hopefully) as DNS server (which is not working properly at the moment).
Windows hosts do not resolve any hosts.
On the box where dnsmasq is installed (and another Gentoo box that I've tried from), it is resolving *some* of the hosts, but not all.

/etc/dnsmasq.conf
Code:

interface=eth0
dhcp-range=192.168.32.10,192.168.35.254,255.255.252.0,24h
dhcp-option=3,192.168.32.1
dhcp-option=6,192.168.32.2
#dhcp-option=6,192.168.32.2,172.16.136.10,172.16.136.13

conf-file=/etc/dnsmasq.conf.static
no-hosts
addn-hosts=/etc/dnsmasq.conf.hosts


Some of the hosts being resolved are found in /etc/dnsmasq.conf.static (where I defined the static DHCP host assignment) - but as I said, not all of those hosts are being resolved.
I tried defining some hosts in /etc/hosts and /etc/dnsmasq.conf.hosts but they are not being recognized.

Any advices?

thank you very much!
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Tue Apr 09, 2013 9:27 pm    Post subject: Reply with quote

I get some inconsistent results, for example:

Gentoo box running dnsmasq cannot resolve (ping) hostname "agent-td1" nor "esxi-32-185":
Code:
AT-QA-DHCP ~ # ping agent-td1
ping: unknown host agent-td1

AT-QA-DHCP ~ # ping esxi-32-185
ping: unknown host esxi-32-185
AT-QA-DHCP ~ #


Another Gentoo box can ping second hostname but not first one.. and both are located in the dhcp.conf.static file on the DHCP server.
Code:
AT-QA-Stor ~ # ping agent-td1
ping: unknown host agent-td1

AT-QA-Stor ~ # ping esxi-32-185
PING esxi-32-185 (192.168.32.185) 56(84) bytes of data.
64 bytes from ESXi-32-185 (192.168.32.185): icmp_req=1 ttl=64 time=0.691 ms
64 bytes from ESXi-32-185 (192.168.32.185): icmp_req=2 ttl=64 time=0.185 ms
64 bytes from ESXi-32-185 (192.168.32.185): icmp_req=3 ttl=64 time=0.186 ms
^C
--- esxi-32-185 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.185/0.354/0.691/0.238 ms



From a Windows machine:
Code:

C:\Users\Administrator>ping agent-td1
Pinging agent-td1 [192.168.32.146] with 32 bytes of data:
Reply from 192.168.32.146: bytes=32 time<1ms TTL=128
Reply from 192.168.32.146: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.32.146:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C
^C

C:\Users\Administrator>ping esxi-32-185
Ping request could not find host esxi-32-185. Please check the name and try again.


Moreover, from the Windows box, the "nslookup" command can resolve the name, but if I ping the name, it is not resolved... WHY IS THAT ?!

Code:
C:\Users\Administrator>nslookup esxi-32-185
Server:  AT-QA-DHCP
Address:  192.168.32.2

Name:    esxi-32-185
Address:  192.168.32.185



I'm puzzled...
Back to top
View user's profile Send private message
MarcusXP
Apprentice
Apprentice


Joined: 18 Apr 2007
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Wed Apr 10, 2013 1:35 pm    Post subject: Reply with quote

is there anyone that can help please?
Back to top
View user's profile Send private message
your_WooDness
Tux's lil' helper
Tux's lil' helper


Joined: 25 Oct 2007
Posts: 77

PostPosted: Thu Apr 11, 2013 7:18 am    Post subject: Reply with quote

Hi,

you should check the /etc/hosts and /etc/resolv.conf files of the DNS clients. Best would be that /etc/hosts only contains entries for localhost, /etc/resolv.conf should be same everywhere or better should be written by dhcp client. But check if there are search pathes added.
Another file that affects name lookups is /etc/nsswitch, which should have the following hosts entry
Code:
hosts:      files dns

/etc/dnsmasq.conf.hosts should contain the fqdn and short names for the hosts.

If you DNS query fails, please do a reverse lookup as well: nslookup <ip-address>

w00d
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum