# /etc/conf.d/hostname

## 666threesixes666

quick q...  why doesn't this service set these up properly, or have an option to set these up properly?  why is this service rail roading my hostname at boot and not offering to properly set it up?

mkultra@mkultra [ ~ ]$ hostname --fqdn

localhost

mkultra@mkultra [ ~ ]$ domainname

(none)

mkultra@mkultra [ ~ ]$ hostname

mkultra

mkultra@mkultra [ ~ ]$ cat /etc/conf.d/hostname 

# Set to the hostname of this machine

hostname="mkultra"

does anyone have proper examples of hostname domainname dnsdomainname nisdomainname ypdomainname nodename?  thx gentoo i <3 you guys!

----------

## blu3bird

nodename is DECnet networks...unless you live in the 1980s you won't be using it.

domainname, nisdomainname, ypdomainname are for NIS/YP. Also quite old, I stopped using it around 2005.

The only import commands are hostname and dnsdomainname.

hostname = the hostname of your system, as configured in /etc/conf.d/hostname. In your case mkultra.

hostname --fqdn will return the full qualified name. This is done via a reverse DNS lookup. If will take the IP of you system and ask your DNS server for the corresponding PTR entry. If you don't have a well configured DNS server in your local network you can also use the /etc/hosts file.

For instance if your IP was 192.168.0.1 you could add a line like this to /etc/hosts:

```
192.168.0.1 mkultra.my.super.cool.domain mkultra
```

After that hostname --fqdn would return mkultra.my.super.cool.domain.

dnsdomainname is similar to hostname --fqdn except it only return the domain part. In the example above that would be my.super.cool.domain.

----------

## 666threesixes666

so

hostname www

& hostname returns www

domainname example.com

& domain name returns example.com

& hostname --fqdn returns www.example.com

is this right?

furthermore....

/etc/hosts

192.168.0.254 www example.com www.example.com localhost localhost.localdomain

^^^ is that correct?  (finally do you mind me setting this in stone on the wiki if alls well?)

my emails getting routed to spam because of localhost.localdomain via sendmail.

----------

## blu3bird

Try this in /etc/hosts:

```
127.0.0.1 localhost localhost.localdomain

192.168.0.254 www example.com www.example.com
```

----------

