Solved

dig resolves a name but ping not. Why?

Posted on 2014-12-21
3
224 Views
Last Modified: 2014-12-21
Hi.

I installed and configured bind9 on a linux debian. From this machine I'm making a dig using one of the defined names in the zone and it works (even if I don't use the @ parameter on dig), so this command is working well:
dig myname.mydomain @127.0.0.1

Open in new window

and also this other:
dig myname.mydomain

Open in new window


However, this command doesn't seems to work:
ping myname.mydomain

Open in new window

Which responds with this error: ping: unknown host ns.grup7.gsx

Why? How can I make it work?
0
Comment
Question by:gplana
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
savone earned 500 total points
ID: 40511572
Chances are you have something in your /etc/hosts file that ping is using.

dig uses DNS only to resolve names.  It is a tool designed to troubleshoot or query DNS servers.

Ping uses mechanisms listed in the /etc/nsswitch.conf file for resolution.  This by default is usually:

hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname

Open in new window


Run the following commands:

grep hosts /etc/nsswitch.conf

and

cat /etc/hosts

They should give you an idea of why the answer from ping is different from the answer from dig.

Post the output of the two commands above if you need further help.
0
 
LVL 15

Author Comment

by:gplana
ID: 40511585
Yes, problem was on /etc/resolv.conf file.  Thank you for your help.
0
 
LVL 15

Author Closing Comment

by:gplana
ID: 40511586
It was not exactly what you said, but you give me a good clue. Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now