Gentoo not having a domainname

Well got my Linode all setup in gentoo, only problem is my domainname isn't showing up, which I think is causing problems with qmail.

I echoed into hostname and dnsdomainname, added domainname to rc level default (and tried boot), and here is my resolv.conf file:

domain garzsbarg.com

nameserver 12.96.160.115

nameserver 216.156.129.66

nameserver 216.234.234.30

search members.linode.com

I also have entries for in etc/hosts, any ideas?

8 Replies

Actually I just noticed whenever I reboot, the top line of resolv.conf is removed, whichs lists domain garzsbarg.com, could that be the problem?

@Crisis:

Actually I just noticed whenever I reboot, the top line of resolv.conf is removed, whichs lists domain garzsbarg.com, could that be the problem?

It sounds like your linode is using DHCP to get its IP address. The DHCP client typically rewrites /etc/resolv.conf with the DNS servers that it is told to use by the DHCP server. I'm not familiar with Gentoo and so I don't know exactly how to switch from using DHCP to a statically defined IP address, but that is what I think you need to do.

Also, I think that instad of "domain xxx.com" you want "search xxx.com". The domain name that your system knows itself by does not come from /etc/resolv.conf; on RedHat it comes from an /etc/sysconfig/network (HOSTNAME=xxx.com). The /etc/resolve.conf entry from your domain name ("search xxx.com") just tells your system that when you enter an unqualified hostname (foo) that it should first search for the name in that domain, i.e. foo.xxx.com …

Sounds like you're doing it right …

http://www.gentoo.org/doc/en/gentoo-x86 … doc_chap19">http://www.gentoo.org/doc/en/gentoo-x86-install.xml#doc_chap19

I've heard reports that our Gentoo image's DHCP client doesn't re-write /etc/resolv.conf on reboots. Sounds like it actually is. I'll have to test it.

If Gentoo uses dhclient, look for a dhclient.conf file (in /etc perhaps). The config allows you to prepend stuff to the resolv.conf file…

-Chris

I assume you are getting li-200.members.linode.com as your domain name (and not some other, completely incorrect name) instead of garzsbarg.com, in which case you need to turn off DHCP to activate the settings in your /etc/hostname and /etc/dnsdomainname files.

For Gentoo you need to edit /etc/conf.d/net as follows:

1) comment out the line````
iface_eth0="dhcp"

2) add a line to statically configure the ethernet interface:````
iface_eth0="xx.xx.xx.xx netmask 255.255.255.0"

where xx.xx.xx.xx is your Linode's IP address (64.5.53.200)

3) add a line to set the default gateway gateway="eth0/yy.yy.yy.yy" where yy.yy.yy.yy is the gateway specified on the network information page linked from your Linode members page.

Thanks guys, I changed it to static and edited resolv.conf, but it is still being changed at boot, now a bit differently:

/etc/resolv.conf
domain garzsbarg.com
search linode.com
nameserver 216.156.129.66
nameserver 216.156.129.65

but when I use the command: domainname, I get:

(none)

On a side note, I do seem to have the web and e-mail up and working so I am not sure if this is affecting anything.

On a gentoo related note, I do have 3 other stnadalone gentoo boxes, so this is more of a figre it out on the linode type question as opposed to figuring out gentoo.

Hi,

What output do you get for

domainname -d

and

domainname -f

When I enter domainname on my gentoo box it comes back with none, even when things are set-up correctly but the two commands above come back with the correct data.

Adam

Adam, those commands do show the correct output, interesting. I wonder why I do not have these symptoms on my other gentoo boxen.

The command domainname with no options shows the nis/yp domain name.

-d requests the domain DNS name

-f requests the FQDN

The command dnsdomainname gives the DNS name when used without options.

Do you have nis/yp set up on your other boxes?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct