LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2012, 01:24 PM   #1
bubbacarter
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 06-07-2012, 01:58 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
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.
 
Old 06-07-2012, 02:32 PM   #3
bubbacarter
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
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#.
 
Old 06-07-2012, 03:06 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
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?
 
Old 06-08-2012, 07:03 AM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
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.
 
  


Reply


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 02:39 PM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM
Debian 5 , after SysCp Installation and configure Ping Valure ( ping: unknown host ) brenner23 Linux - Networking 1 07-14-2010 09:01 PM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 09:10 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:49 PM.

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