# Unknown Host

## berryman77

I'm still fairly new to gentoo.  I did an emerge -u faad2 and got a whole lot more than what I expected along with about 30 new configuration files.  I looked at each config file individually and kept certain ones like /etc/hosts and /etc/fstab.  But now when I issue the command

```
startx
```

I get an error:

```
Looking up host name:  Unknown host
```

X comes up and everything seems fine.  I get the same error when I run bzflag.  Although bzflag starts up and runs fine.  I don't seem to be having any (new) network problems, but the error message is annoying.

Randall

----------

## Scandium

You might give

```
echo [hostname] > /etc/hostname
```

a try.

XFree looks there as far as I know and if it isn't set it often starts up very slow etc. I don't know wether this happens to you to, but you didn't name that file, so I guess that's the reason

----------

## holek

I'm having the same issue.

I've got my hostname in /etc/hostname so i think it's not it.

I noticed something else i have smbd running and when i try to connect to my host by it's hostname i can't. I can do it only by IP. In smb.conf i didn't set netbios name so it should take it from hostname.

So what other files are responsibble for naming the host or something like it.

Thank's in advance

----------

## berryman77

I already have /etc/hostname set and I can ping that address with no problem.  I'm not running samba.  What do I have to set besides /etc/hosts and /etc/hostname?

----------

## holek

OK I've got this:

when i run hostname i get my hostname correct, but when i run it with "-f" option (which should give me the full hostname) i get unknown host.

So what's up with that ?

----------

## holek

OK I got it.

Mistake is in /etc/hosts.

I accidently removed the line 

m.y.i.p            myhostaname

 :Embarassed: 

Actually gentoo did it for me because of my CONFIG_PROTECT="-*"   :Rolling Eyes: 

----------

## berryman77

 *holek wrote:*   

> OK I've got this:
> 
> when i run hostname i get my hostname correct, but when i run it with "-f" option (which should give me the full hostname) i get unknown host.
> 
> So what's up with that ?

 

I have the same problem, but my /etc/hosts file looks OK.  It looks like this:

```
127.0.0.1     myhostname     localhost.localdomain     localhost
```

This has worked fine up until now.  Is there something wrong with this configuration?

When I type hostname, I get myhostname.  When I type hostname -f, I get  unknown host.

----------

## holek

OK U have to add a line to your /etc/hosts like this:

---->   xxx.xxx.xxx.xxx (your IP)hostname (the same thing you got in /etc/hostname)

Tell me if it works

----------

## tHeoo

```

OK I've got this: 

when i run hostname i get my hostname correct, but when i run it with "-f" option (which should give me the full hostname) i get unknown host. 

So what's up with that ?

```

I'm in exactly the same situation. I had it with Xfree but left it because it didn't really harm. Now, I want apache and it doesn't start correctly due to the misconfigured hostname. Notice that I cannot do this in hosts:

```

131.211.69.123 FT190

```

Because this ip number changes with dhcp all the time.

Moreover, I would like to know what the file /etc/hostname requires?

'FT190' or 'FT190.theo.uu.nl'? I thought the last. Changing doesn't help anyway.

Hope someone helps me out.

Greetings,

Maarten Wisse

----------

## tHeoo

The solution to my problem. Hosts should have:

```

127.0.0.1 ft190   ft190.theo.uu.nl   localhost

```

Now, everything works correctly.

----------

## dma

 *tHeoo wrote:*   

> The solution to my problem. Hosts should have:
> 
> ```
> 
> 127.0.0.1 ft190   ft190.theo.uu.nl   localhost
> ...

 

That will cause ALL SORTS of problems.  It won't bind to the right interface I believe.  I did this and it broke one of my IRC bots.  I recompiled perl and everything and it turned out that it was that blasted line.

----------

## tHeoo

I had some problems too. Instead, use:

```

127.0.0.1   localhost

127.0.0.2   ft190.theo.uu.nl   ft190

```

I took this from my old SuSE 7.2 config files.

Greetings,

Maarten Wisse

----------

