With dnsmasq as the DNS server, 'dig' succeeds, but 'nslookup' and 'ping' fail

Posted by einpoklum on Server Fault See other posts from Server Fault or by einpoklum
Published on 2013-10-20T12:06:23Z Indexed on 2013/10/20 15:56 UTC
Read the original article Hit count: 301

Filed under:
|
|
|
|

I installed dnsmasq on a machine of mine (It's a Kubuntu 12.04 LTS), backed only by /etc/hosts (no connection to the Internet until later). Now, when I'm on the same machine as the dnsmasq - or any other machine on the server, I can dig mymachine and get 192.168.0.1, but if I try to nslookup mymachine, I get:

>> connection timed out; no servers could be reached

Tried also nslookup mymachine.mynicedomain.org - didn't work either. pinging fails.

How can I the DNS lookups to work? Is the problem with the nsswitch entries? The dnsmasq configuration?

Additional Information

In the server's /etc/hosts:

192.168.0.1   mymachine

In the server's nsswitch.conf:

hosts: files mdns4_mininal [NOTFOUND=return] dns mdns4

(admittedly, this is a bit weird)

In resolv.conf (which is generated by dnsmasq):

nameserver 127.0.0.1
search mynicedomain.org

In the server's /etc/hosts.allow:

domain: ALL    

In the other machines' /etc/resolv.conf (this is set by the DHCP client):

nameserver 192.168.0.1
search mynicedomain.org

Finally, here's the ipconfig output from one of the client machines on the network (running Windows 7):

Connection-specific DNS Suffix  . : mynicedomain.org
Description . . . . . . . . . . . : Intel(R) 82579LM Gigabit Network Connection
Physical Address. . . . . . . . . : 12-34-56-78-9A-BC
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.0.50(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Sunday, October 20th 2013 16:20:25
Lease Expires . . . . . . . . . . : Sunday, October 20th 2013 18:20:24
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.1
NetBIOS over Tcpip. . . . . . . . : Enabled

Notes:

© Server Fault or respective owner

Related posts about dns

Related posts about dnsmasq