# Hostname

## Tubee

Gentoo doesn't seem to recognize my hostname, or something is wrong about it. My /etc/conf.d/hostname looks like this: 

```
HOSTNAME="localhost"
```

 and my /etc/hosts file looks like this:

```
127.0.0.1       localhost

::1             localhost

```

Still my hostname is always something that I get from the network, like now its hoasnet-fe35dd00-68

What is wrong? Appreciate the help!

----------

## notHerbert

Tubee,

I guess you missed the part in the handbook about setting the hostname.

Here is a paraphrased example *Set host and domain name wrote:*   

> # cd /etc
> 
> # echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts
> 
> # sed -i -e 's/HOSTNAME.*/HOSTNAME="mybox"/' conf.d/hostname
> ...

 

Of course you can change mybox and mybox.at.myplace to whatever you want, as long as they are consistent.

----------

## eccerr0r

seems someone else is having the same issue.  dhcpcd, or whatever your DHCP client is setting up a different hostname when it acquires a lease.  I found that passing -H to dhcpcd does this behavior, but I'm not sure why it's doing it without -H...

----------

