Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
09-27-2005, 11:15 AM
|
#1
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Rep:
|
can't resolve localhost
Hello,
I cannot ping my oun machine by using the hostname. It will work fine using the IP.
Typing hostname will give me the correct hostname. The /etc/hosts has all the correct entries. Can someone give me a clue as to how to fix it? Thanks very much!
|
|
|
09-27-2005, 12:07 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Is the loopback device up?
ifconfig
|
|
|
09-27-2005, 12:52 PM
|
#3
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Original Poster
Rep:
|
Yes, the lo device 127.0.0.1 is up.
|
|
|
09-27-2005, 01:07 PM
|
#4
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
What do you have in your hosts file:
cat /etc/hosts
|
|
|
09-27-2005, 02:25 PM
|
#5
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Original Poster
Rep:
|
As I said, the /etc/hosts file is fine and no change to it will correct the problem. Here it is anyway... This has always worked, but now I can't ping linea.
127.0.0.1 linea localhost.localdomain localhost
192.168.1.103 linea
The problem has something to do with the resolver and is not a typical tweak. Thanks for taking shots at it.
|
|
|
09-27-2005, 02:33 PM
|
#6
|
Member
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184
Rep:
|
Are you able to ping "localhost"? If not, you might have a problem with your nsswitch.conf file.
|
|
|
09-27-2005, 03:34 PM
|
#7
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Original Poster
Rep:
|
Nope, can't ping localhost. Here is my nsswitch.conf file. In "hosts:" I moved "nis" to the end of the line so it would be sure to find "files" . Nada.
passwd: compat
group: compat
hosts: files dns nis
services: nis [NOTFOUND=return] files
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
ethers: nis [NOTFOUND=return] files
netmasks: nis [NOTFOUND=return] files
netgroup: nis
bootparams: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
automount: files
aliases: nis [NOTFOUND=return] files
|
|
|
09-27-2005, 03:52 PM
|
#8
|
Member
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184
Rep:
|
What is the exact error message when you try to ping "localhost". Also, please post the output of your resolv.conf file.
|
|
|
09-27-2005, 04:33 PM
|
#9
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Original Poster
Rep:
|
[root@linea root]# ping localhost
ping: unknown host localhost
cat /etc/resolv.conf
nameserver 63.249.95.8
nameserver 63.249.95.9
nameserver 192.168.1.1
Seems like resolv.conf would be the problem but I have my router and 2 DNS servers listed.
When I boot up I get," Could not look up Internet address for linea. It may be possible to correct this problem by adding lines to /etc/hosts.
Thanks
|
|
|
09-27-2005, 06:41 PM
|
#10
|
Member
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184
Rep:
|
First of all what distro are you using? I think there maybe an error in your /etc/hosts file. You can try renaming it and then re-entering it manually into a new file. Sometimes there's a file corruption of some type that can't be seen visually.
|
|
|
09-27-2005, 08:43 PM
|
#11
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Original Poster
Rep:
|
I'm using RedHat 9.
Tried eliminating any possable errors in the hosts file by creating another manually. No difference.
I did notice that I can't ping anything in the host file. The /etc/hosts file is not being read, even when I create a new one with just a couple of lines.
This all started when I attempted to upgrade MySql and found I had to also upgrade the libraries... This must have screwed up something relating to the resolver.
Thanks for your Ideas and feedback aznluvsmc.
|
|
|
09-27-2005, 09:00 PM
|
#12
|
Member
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184
Rep:
|
Do you know what libraries you upgraded?
|
|
|
09-28-2005, 12:23 PM
|
#13
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Are you using nscd? Try turning it off then ping:
service nscd stop
ping localhost
|
|
|
09-28-2005, 01:32 PM
|
#14
|
Member
Registered: Sep 2003
Location: India
Distribution: Debian
Posts: 50
Rep:
|
127.0.0.1 linea localhost.localdomain localhost
192.168.1.103 linea
_____________________________
can u remove linea in the second coloumn and try..
something like
127.0.0.1 localhost.localdomain localhost
192.168.1.103 linea
|
|
|
09-28-2005, 05:12 PM
|
#15
|
LQ Newbie
Registered: Jul 2004
Distribution: RedHat
Posts: 9
Original Poster
Rep:
|
Not running nscd. The /etc/hosts file isn't read no matter what is listed in any order. It must have something to do with ld.so, glibc or libc libraries as these are the aRPMs I attempted to upgrade. Tried doing a Redhat upgrade, but now think I'll have to do a complete install which is overkill to fix a broken library. Thanks.
|
|
|
All times are GMT -5. The time now is 09:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|