Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running dd-wrt and I configured it's dns server to resolve a few hosts inside my network.

When I use dig to lookup these hosts, they are resolved OK, but when I try to ping those hosts I always receive an unknown host error message.

For example:

obe:~ simao$ dig dd-wrt
; <<>> DiG 9.6.0-APPLE-P2 <<>> dd-wrt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44026
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;dd-wrt.                IN  A

;; ANSWER SECTION:
dd-wrt.         0   IN  A   192.168.1.1

But then:

obe:~ simao$ ping dd-wrt
ping: cannot resolve dd-wrt: Unknown host

Any ideas?

Thanks.

share|improve this question
add comment

1 Answer 1

This seems to me like a Mac OS X specific problem, after doing some googling. I found quite a few threads on forums discussing this issue. An example:

http://discussions.apple.com/thread.jspa?threadID=2213373

Apparently it could be because your /etc/resolv.conf has two DNS-servers configured, and dig goes through both of them to find the host 'dd-wrt', while ping gives up after using only one of the DNS-servers. Try reversing the order of your servers in resolv.conf

share|improve this answer
1  
dig's manpage states its behavior with respect to OSX's resolver libraries, specifically stating that a dig response can be different from OSX's normal resolving functions. Since it's unclear what 'domain' the host 'dd-wrt' belongs to, then you might want to fully qualify the name by appending a '.' to the end: ping dd-wrt. –  Nevin Williams May 6 '13 at 1:20
add comment

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.