# [solved] hostname --fqdn => Host name lookup failure

## Yminus

Regardless of which custom host name I write into /etc/conf.d/hostname, this is the result:

```
hostname --fqdn

hostname: Host name lookupfailure
```

I even tried "local" as host name. Solely for "localhost" as host name, hostname gives:

```
hostname --fqdn

hostname
```

Neither the Gentoo Linux x86 Handbook

nor 

```
man hostname
```

gives me a clue what a valid hostname may look like. Any hints?Last edited by Yminus on Thu Jan 17, 2008 7:17 pm; edited 1 time in total

----------

## Old School

```
# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="badboy"
```

I hope that helps.

----------

## blu3bird

Your /etc/hosts is missing an entry for your hostname  :Wink: 

 */etc/conf.d/hostname wrote:*   

> HOSTNAME="mycomputer"

 

 */etc/hosts wrote:*   

> 127.0.0.1 mycomputer.mydomain.local mycomputer

 

after setting these settings you'll get:

```
$ hostname

mycomputer

$ hostname --fqdn

mycomputer.mydomain.local
```

----------

## Yminus

Thanks, this solved the problem!

----------

## bunder

 *blu3bird wrote:*   

> Your /etc/hosts is missing an entry for your hostname 
> 
>  */etc/hosts wrote:*   127.0.0.1 mycomputer.mydomain.local mycomputer 
> 
> 

 

"localhost localhost.localdomain" should still remain on that line as well...

cheers

----------

