LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   localhost.localdomain (https://www.linuxquestions.org/questions/linux-newbie-8/localhost-localdomain-312822/)

RJEmery 04-13-2005 10:50 AM

localhost.localdomain
 
I am working with Gnome/Fedora Core 3. Whenever I attempt to login, I get the dialog window:

=============================================
Could not look up internet address for localhost.localdomain
This will prevent GNOME from operating correctly.
It may be possible to correct the problem by adding
localhost.localdomain to the file /etc/hosts
[Log in Anyway] [Try Again]
=============================================

The above is the result of some errant action I took, but I do not know what. I seek guidance on reversing the error and fixing the problem. When I "Log in Anyway", all appears well.

reddazz 04-13-2005 10:55 AM

Make sure the localhost.localdomain is in /etc/hosts like below
Code:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1              localhost.localdomain localhost


RJEmery 04-13-2005 11:50 AM

Reddazz,

What was it that I did to cause this /etc/hosts update to become necessary?

And why did not that [network?] process automatically make the update itself?

reddazz 04-13-2005 01:39 PM

I don't know, but its obviously something to do with network configuration. I have noticed that if you use KDE, this error does not show up.

RJEmery 04-13-2005 02:40 PM

Reddazz,

FWIW, the only network configuration action I took was to create a dialup to my ISP. I surmise that had to be what triggered the condition, but why that process did not also update /etc/hosts is beyond me. In any event, putting the code you provided in /etc/hosts seems to have corrected the matter. Thank you for your assistance.

Dimension User 05-22-2005 04:55 PM

I can't believe it! I am having the same problem, and it started after I created my dial-up account, too. The only difference is my message leaves out the .localdomain part ("Could not look up Internet address for localhost. This will prevent GNOME...")
I tried to fix with reddazz's code, but I can't find the correct file. I tried vi /etc/hosts at the terminal, but I just get a blank page, and I also tried to open it with Nautilus by navigating to /etc and double-clicking the hosts icon, but it says "Unable to access /etc/hosts."
What am I doing wrong?

btmiller 05-22-2005 05:06 PM

Your hosts file probably doesn't exist, which would definitely cause this problem. Just open it, type in the line, and then save it.

reddazz 05-22-2005 05:13 PM

Try running the network configuration tool and change the host name from there.

Dimension User 05-27-2005 05:27 PM

Thank you both for your posts. It's great to have the help. Would the best method for creating the file be to use vi from the terminal, add the code,

Quote:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
and save it as hosts?
Also, is it okay to use something beside localhost.localdomain (eg 127.0.0.1 anyname.anywhere anyname )?
Thanks again for your help!
P.S. I did try your suggestion reddazz, but I wasn't sure where to change the host name. The tool I used was system settings>network. Did I use the wrong one? That would be a lot easier than using vi for a beginner (like me:p).

reddazz 05-27-2005 05:34 PM

Thats the right tool.

Dimension User 05-27-2005 08:31 PM

So, should I add anyname.anywhere under the DNS tab, and should I type it just like that? That's the only place that seems editable. The host tab is empty for me, which is why I was confused before.

reddazz 05-27-2005 08:45 PM

You make the changes in the host tab. I will post the exact details when I am able to access my fedora core partition.

btmiller 05-27-2005 09:04 PM

You definitely need the localhost.localdomain entry as some stuff relies on it. You can also give your computer another name (a machine can have many names associated with it).

reddazz 05-27-2005 09:11 PM

Okay, start the network confiuration tool, go to the hosts tab, click on edit. For the ip address, you put 127.0.0.1, for the hostname put something that won't clash with other domains on the web e.g. myhost.mydomain.lan and for the aliases, you need to put the hostname e.g myhost as well as localhost.localdomain & localhost. So your dialg box would be something like below,
Code:

Address: 127.0.0.1
Hostname: myhost.mydomain.lan
Aliases: myhost localhost.localdomain localhost

Make sure you save your changes before exiting.

Dimension User 05-27-2005 09:37 PM

Thank you both again! I can finally fix this problem that's been egging me for at least a month.:)
Quote:

You definitely need the localhost.localdomain entry as some stuff relies on it. You can also give your computer another name (a machine can have many names associated with it).
Thanks btmiller. That's why I don't like to barrel ahead on something this sensitive myself. I wasn't sure whether the localhost part was necessary; I probably would've left it out.

Your detailed instructions are also very much appreciated, reddazz. It's nice for a newbie to have someone actually run through a whole process sometimes to double-check their own method.
I just have one more question to bother you with. I'm not on a network (except for my dialup ISP), so should I put the lan part of Hostname: myhost.mydomain.lan in the hostname line?


All times are GMT -5. The time now is 09:17 PM.