Solved

dig resolves a name but ping not. Why?

Posted on 2014-12-21
3
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month11 days, 15 hours left to enroll

623 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