Take the 2-minute tour ×

I have a server running Debian etch. It runs [qmail] and sends mail. Mail server works correct but the strange thing is from server itself it can't resolve hostnames. I can use nslookup and dig correctly.

#ping google.com
ping: unknown host google.com

#dig google.com

; <<>> DiG 9.2.4 <<>> google.com
;; global options:  printcmd
;; Got answer:
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 4, ADDITIONAL: 4

;google.com.                    IN      A

google.com.             300     IN      A
google.com.             300     IN      A
google.com.             300     IN      A
google.com.             300     IN      A
google.com.             300     IN      A
google.com.             300     IN      A

google.com.             134830  IN      NS      ns1.google.com.
google.com.             134830  IN      NS      ns2.google.com.
google.com.             134830  IN      NS      ns3.google.com.
google.com.             134830  IN      NS      ns4.google.com.

ns1.google.com.         105732  IN      A
ns2.google.com.         105732  IN      A
ns3.google.com.         105732  IN      A
ns4.google.com.         105732  IN      A

;; Query time: 172 msec
;; WHEN: Sun Dec 20 00:39:35 2009
;; MSG SIZE  rcvd: 260

There is a point that i'm suspicious of is there is a package that was installed not used by another application called [resolvconf]. And is creates a symlink to original resolv.conf file.
My iptables list is empty.

share|improve this question
add comment

1 Answer

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

hosts:       files dns

Dig is a DNS utility so it checks DNS. qmail might also be ignoring nsswitch.conf. Most other programs that use standard DNS calls in C library honor it. If yours dows not contain "dns" in it, it is pretty normal that DNS lookups don't work for most things.

share|improve this answer
add comment

Your Answer


