View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 11-25-2011, 12:35 AM   #1
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 30
Can ping IP, but cannot ping hostname

I set-up a test server with NAT, so access will be on the interface to be treated as public but it's still a private IP. <-->, where in is defined in eth1, while was defined in eth0. cannot be accessed directly. All devs/support must ssh to

Then from, we can ping the IP (, but if we ping the hostname it doesnt pass. If we do nslookup for, it can be resolved. Our temporary solution is to put it in /etc/hosts. We cant do it, since we'll be placing at least 50 servers on this segment, that's why we placed it on the DNS.

Any though guys?
Old 11-25-2011, 12:49 AM   #2
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
I have had a similar problem, related to zeroconf, seems that nearly every distro i have installed lately requires me to do this...

open up /etc/nsswitch.conf

comment out the line
#hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
and add
hosts:          files dns mdns4
Other than that, is the firewall configured to let dns requests through?
Old 11-30-2011, 02:18 AM   #3
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Original Poster
Rep: Reputation: 30
It doesn't work for my setup.

Yep, I think it must be on the firewall side.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 03:39 PM
FC13 install can ping by hostname, ssh by hostname fails jeffk42 Linux - Networking 4 11-14-2011 12:27 PM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 06:32 AM
BIND9 SLOW ping when ping by hostname dschuett Linux - Networking 10 02-02-2011 05:17 PM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 05:57 AM

All times are GMT -5. The time now is 11:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration