# Need Help Setting "domainname" [SOLVED]

## JohnTD

Problem: I can't successfully set "domainname" for my system.  Before I go on to set up and configure SAMBA, I would like to fix this.  (As an aside, I have done this before for my other systems, but I am having a mental block on fixing this particular system.)

System Information:

 Kernel: 2.6.14-gentoo-r2

 Hardware: Dell E510

 Processor: Intel Pentium 4 630

 RAM: 1GB

Things That do Work:

 I have correctly set hostname (please see below).

Things That I've Tried:

 The hostname command returns the following...

```

ronin ~ # hostname -v

gethostname()=`ronin'

ronin

ronin ~ # hostname --fqdn

hostname: Unknown host

```

 I have edited /etc/conf.d/domainname.  The code snip below shows the non-comment lines in this file:

```

OVERRIDE=1

DNSDOMAIN="tiedenet"

```

 I have edited /etc/hosts.  The code snip below shows mostly non-comment lines in this file:

```

127.0.0.1     ronin.tiedenet   localhost

192.168.0.101 ninja.tiedenet   ninja

192.168.0.102 samuari.tiedenet samuari

192.168.0.103 gaijin.tiedenet  gaijin

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

 I have set domainname to the default runlevel.

```

ronin ~ # rc-update -s

           alsasound | boot

             apache2 |

            bootmisc | boot

             checkfs | boot

           checkroot | boot

               clock | boot

            coldplug | boot

         consolefont | boot

         crypto-loop |

               cupsd |      default

                dbus |      default

          domainname |      default

              esound |

                famd |

                 gpm |

                hald |      default

              hdparm |

            hostname | boot

             hotplug |

               ivman |      default

             keymaps | boot

                lisa |

               local |      default nonetwork

          localmount | boot

             metalog |      default

             modules | boot

            net.eth0 |      default

              net.lo | boot

            netmount |      default

                 nfs |      default

            nfsmount |      default

                nscd |

             numlock |

             portmap |      default

             pwcheck |

             reslisa |

           rmnologin | boot

              rsyncd |

               samba |

           saslauthd |

                sshd |

             urandom | boot

          vixie-cron |      default

              vmware |

                 xdm |

```

 I have rebooted since I set the runlevel of domainname.

 I have used Google to try to solve this on my own.  Should someone else who needs help stumble onto this post, below is one that I think is particularly useful (although I am still stumped):[/list]

http://gentoo-wiki.com/TIP_Setup_Your_FQDN

Thanks in advance for help with this.Last edited by JohnTD on Sat Dec 31, 2005 2:32 am; edited 1 time in total

----------

## pjp

Not sure if it matters (I don't think I had to do it manually), but do you have "domain tiedenet" in /etc/resolv.conf?

Moved from Installing Gentoo

----------

## xsam

i have the same problem~

 the system reminds me using /etc/con.d/hostname instead of  /etc/hostname even i have done "echo mychaine > /etc/con.d/hostname".

----------

## UberLord

 *xsam wrote:*   

> i have the same problem~
> 
>  the system reminds me using /etc/con.d/hostname instead of  /etc/hostname even i have done "echo mychaine > /etc/con.d/hostname".

 

So remove /etc/hostname then.

----------

## JohnTD

 *pjp wrote:*   

> 
> 
> Not sure if it matters (I don't think I had to do it manually), but do you have "domain tiedenet" in /etc/resolv.conf? 
> 
> 

 

Yes, below is the contents of file /etc/resolv.conf:

```

domain tiedenet

nameserver 192.168.0.1

search tiedenet

```

----------

## JohnTD

I kept working at this and have a solution.  (I am including some extra stuff I tried in case my troubleshooting logic helps someone else.)

The previous comment about the file /etc/resolv.conf motivated the following line of thought.

On my network, only the machines "ninja", "gaijin" and "ronin" are presently connected.  I have a D-Link (DI-604) router configured as a static DHCP server (its IP address is 192.168.0.1).  I have done this to simplify my /etc/fstab for the NFS configuration.  On the other systems ("ninja" and "gaijin"), the fully qualified domain name is returned correctly.  For example, ...

```

gaijin ~ # hostname --fqdn

gaijin.tiedenet

```

The router is automatically set as the nameserver on all the machines because dhcpd generates the /etc/resolv.conf file.  I have not set up NIS yet so this is out of the picture.

I reviewed the following Gentoo document to see if I missed anything...

http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml

From this I changed my /etc/conf.d/net to look like this (comment lines have been dropped)...

```

iface_eth0="dhcp"

dhcpcd_eth0="-HD"

dhcpcd_eth0="-N"

```

This change didn't fix the problem after a reboot but I did change it so here it is.

Then I looked at /etc/hosts.  My previous version is above.  The critical line is...

```

127.0.0.1     ronin.tiedenet   localhost

```

I changed this line to ...

```

127.0.0.1     ronin.tiedenet   ronin   localhost

```

... and, on reboot, the domainname is correctly returned.

```

ronin ~ # hostname --fqdn

ronin.tiedenet

```

Thank you, pjp.  Your suggestion was enough to get me to a resolution.  In retrospect, this seems like a pretty boneheaded mistake but then they all do.    :Wink: 

----------

## JohnTD

To UberLord: I tried to modify the Subject line in my reply to "SOLVED" but it didn't change.  I'm a "nOOb" so I probably did it incorrectly.  Sorry.  I hope this thread helps someone else anyway.

----------

## golding

 *JohnTD wrote:*   

> To UberLord: I tried to modify the Subject line in my reply to "SOLVED" but it didn't change.  I'm a "nOOb" so I probably did it incorrectly.  Sorry.  I hope this thread helps someone else anyway.

 

Go to the parent post (first message) and click on "edit" (it will only be there if you are the poster of that message).

Put [SOLVED] at the end of the 'Subject' line then click 'Submit'

----------

