LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   can't ping name but can ping ip# (https://www.linuxquestions.org/questions/linux-networking-3/cant-ping-name-but-can-ping-ip-949061/)

bubbacarter 06-07-2012 01:24 PM

can't ping name but can ping ip#
 
On my linux boxes I can ping by IP# but not by name (ie. zen.vv.local)
On my Windows machines I can ping the servers via name and by IP#.
my nslookup comes back correctly
I can do a traceroute and it comes back correctly.

any suggestions? it is only not working on my SUSE Linux servers.

tronayne 06-07-2012 01:58 PM

You need an entry in /etc/resolv.conf containing one (preferably two) DNS server addresses; your ISP ought to provide DNS service or check for open DNS servers on Google.

The Google Dynamic Name System (DNS) servers are free to use. The entry in /etc/resolv.conf would look like this:
Code:

search com
nameserver 8.8.8.8
nameserver 8.8.4.4

You do not need any more than two entries in that file.

For you local machines, if you're using fixed-IP addressing (or have set an address in your DHCP configuration), add entries of this form for them in /etc/hosts:
Code:

# For loopbacking.
127.0.0.1                localhost
192.168.1.10                fubar.com fubar
192.168.1.15                InkJet
192.168.1.20                snafu.com snafu
192.168.1.30                pita.com pita

Hope this helps some.

bubbacarter 06-07-2012 02:32 PM

updated info
 
Thanks for the reply.

I do have my local DNS IP and my state IP#'s in the etc/resolv file

I added one of my OES servers in the /etc/hosts file on my dns server and I was able to ping it by name then. So that helps, but doesn't tell me what the problem is, and it still doesn't let me ping my xp workstations from this server via name, just IP#.

jefro 06-07-2012 03:06 PM

Hosts file should have corrected the issue no matter if it was a netbios name or not. It is possible I guess that the name could be appended.


nslookup name returns correct ip based on what does it say who resolved it?

tronayne 06-08-2012 07:03 AM

I may be a little confused -- in your /etc/resolv.conf file there should only be DNS server addresses (generally a maximum of three). Keep in mind that /etc/resolv.conf is for access to the Internet Domain Name System (DNS), not really for LAN resolution (but, yeah, it can be used that way, sorta, kinda). Your entries will be in descending order the closest DNS server electrically to you, followed by a second, followed by a third (usually unnecessary) where if the first is not available the second will be used (and if the second is not available the third will be used). If the first DNS server is not available it takes some time before the resolver switches to the second and so on.

/etc/hosts, on the other hand, is a separate mechanism (no DNS required) and is useful for locating addresses by name on your LAN; /etc/resolv.conf is for the outside world, /etc/hosts is for the inside world. If the address and name are in /etc/hosts, you won't be looking at a DNS server at all; quick like a bunny that.

It's also useful if you have Ethernet printers (or plotters or other devices) with fixed-IP addresses in /etc/hosts -- you can ping any device by name without ever touching a DNS server.

There is, of course, more to it and you can scan through the manual pages for hosts and resolv.conf for more complete information but, basically, use /etc/hosts for the inside and /etc/resolv.con for the outside and life will be less complicated.

Hope this helps some.


All times are GMT -5. The time now is 12:10 AM.