Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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, if I dig mymachine, I 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 (Edit:) succeeds. This happens both on the server machine itself and on other machines on the network.

How can I the DNS lookups to work? What problem is preventing nslookup from succeeding?

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; but I also tried:

hosts: files dns

instead, with the same effect)

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

Relevant netstat output on the server:

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
tcp        0      0 192.168.0.1:53          0.0.0.0:*               LISTEN

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:

share|improve this question
    
So far all you (appear) to know is that dnsmasq is listening and responding on the server's 127.0.0.1 intrface. Is dnsmasq listening on 192.168.0.1 (dig @192.168.0.1 ... | netstat ...)? Can the remote machines contact 192.168.0.1 at all (ping ssh etc )? –  Iain Oct 21 '13 at 6:52
    
@Iain: Yes it is, and yes they can. Updated question accordingly. –  einpoklum Oct 21 '13 at 7:01

1 Answer 1

Have you configured /etc/resolv.conf? If not you it should be as follows:

search mynicedomain.org
nameserver 192.168.0.1 

When you use BIND or other DNS Servers, you should change /etc/nsswitch.con file accordingly.

The following options are available:

dns

Use the Domain Name System (DNS) service to resolve the address. This makes sense only for host address resolution, not network address resolution. This mechanism uses the /etc/resolv.conf file.

files

Search a local file for the host or network name and its corresponding address. This option uses the traditional /etc/hosts and /etc/network files.

Your /etc/nsswitch.conf file should contain a like this, to enable dns lookups.

hosts:       dns files
share|improve this answer
    
Yes, you are correct. I was trying to drill it down step by step. As all the configuration seems correct. I guess the problem is here--> hosts: files mdns4_mininal [NOTFOUND=return] dns mdns4 Check the following link You need to install apt-get install winbind –  Zeeshan Oct 20 '13 at 15:01
    
okay deleted you can check the link in my last comment, if it works for you –  Zeeshan Oct 20 '13 at 15:06
    
Well, it turns out pinging actually works. I was running ping with a wrong setup before. The conundrum is still basically the same though. –  einpoklum Oct 21 '13 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.