Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Domainname not being set.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
welp
Retired Dev
Retired Dev


Joined: 24 Sep 2005
Posts: 103
Location: Ipswich, UK

PostPosted: Sat May 13, 2006 6:05 am    Post subject: Domainname not being set. Reply with quote

I've set the domainname in /etc/conf.d/domainname, /etc/hosts and /etc/resolv.conf, yet when I boot my computer, the login screen says ""This is welpServer1.unknown_domain".

This is a fresh install (finished this morning) and I'm pretty sure i did it properly. The domainname is supposed to be 01welp.co.uk.

The output of hostname --fqdn is "hostname: No address associated with name" Don't know if that's going to be of any use to anyone, but still...

welp
_________________
Gentoo/BSD, Gentoo/Alt AT and Bugday lead
AMD64, Xfce, Sunrise, www-servers, net-irc, lang-misc, Artwork
If you find a bug, submit it! Bugzilla
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Sat May 13, 2006 6:27 am    Post subject: Reply with quote

What specifically did you put into each file?
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3941
Location: Hamburg

PostPosted: Sat May 13, 2006 6:57 am    Post subject: Reply with quote

For some cases it's enough to set NISDOMAIN in /etc/conf.d/domainname and change the "\O" to "\o" in /etc/issue.
Back to top
View user's profile Send private message
welp
Retired Dev
Retired Dev


Joined: 24 Sep 2005
Posts: 103
Location: Ipswich, UK

PostPosted: Sat May 13, 2006 7:09 am    Post subject: Reply with quote

/etc/hosts:
Code:

# /etc/hosts:  This file describes a number of hostname-to-address
#              mappings for the TCP/IP subsystem.  It is mostly
#              used at boot time, when no name servers are running.
#              On small systems, this file can be used instead of a
#              "named" name server.  Just add the names, addresses
#              and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $
#

127.0.0.1       localhost       welpServer1.01welp.co.uk


/etc/conf.d/domainname:
Code:

# /etc/conf.d/domainname

# When setting up resolv.conf, what should take precedence?
#  0 = let dhcp/whatever override DNSDOMAIN
#  1 = override dhcp/whatever with DNSDOMAIN

OVERRIDE=1

# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf
# (domain entry in /etc/resolv.conf and FQDN in /etc/hosts).
#
# DNSDOMAIN merely sets the domain entry in /etc/resolv.conf, see
# the resolv.conf(5) manpage for more info.

DNSDOMAIN="01welp.co.uk"

# For information on setting up NIS, please see:
#   http://www.linux-nis.org/nis-howto/HOWTO/

NISDOMAIN=""


/etc/resolv.conf:
Code:

# Generated by dhcpcd for interface eth0
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
domain 01welp.co.uk


(I replaced the IPs of the nameservers for security reasons :wink:)

If you want me to paste anymore info (hostnames and so on), let me know
_________________
Gentoo/BSD, Gentoo/Alt AT and Bugday lead
AMD64, Xfce, Sunrise, www-servers, net-irc, lang-misc, Artwork
If you find a bug, submit it! Bugzilla
Back to top
View user's profile Send private message
runningwithscissors
Guru
Guru


Joined: 21 Apr 2006
Posts: 454
Location: the third world

PostPosted: Sat May 13, 2006 7:40 am    Post subject: Reply with quote

Welp wrote:
/etc/hosts:
Code:

# /etc/hosts:  This file describes a number of hostname-to-address
#              mappings for the TCP/IP subsystem.  It is mostly
#              used at boot time, when no name servers are running.
#              On small systems, this file can be used instead of a
#              "named" name server.  Just add the names, addresses
#              and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $
#

127.0.0.1       localhost       welpServer1.01welp.co.uk



Try this line

Code:

127.0.0.1 welpServer1.01welp.co.uk welpServer1  localhost.localdomain  localhost


Log out. And check.
Back to top
View user's profile Send private message
welp
Retired Dev
Retired Dev


Joined: 24 Sep 2005
Posts: 103
Location: Ipswich, UK

PostPosted: Sat May 13, 2006 8:45 am    Post subject: Reply with quote

Bingo! It works, thanks - how come that happened?
_________________
Gentoo/BSD, Gentoo/Alt AT and Bugday lead
AMD64, Xfce, Sunrise, www-servers, net-irc, lang-misc, Artwork
If you find a bug, submit it! Bugzilla
Back to top
View user's profile Send private message
runningwithscissors
Guru
Guru


Joined: 21 Apr 2006
Posts: 454
Location: the third world

PostPosted: Sat May 13, 2006 9:19 am    Post subject: Reply with quote

Welp wrote:
Bingo! It works, thanks - how come that happened?


Credit where credit is due:

http://gentoo-wiki.com/FAQ_Setting_up_your_FQDN

;)
Back to top
View user's profile Send private message
troymc
Guru
Guru


Joined: 22 Mar 2006
Posts: 553

PostPosted: Sat May 13, 2006 10:29 am    Post subject: Reply with quote

Welp wrote:
Bingo! It works, thanks - how come that happened?


Because in /etc/hosts, the 1st entry is the address, the 2nd is the hostname, and everything else are just aliases.

The system looks at the 2nd entry to determine the domainname. Yours was simply: localhost.

So it could not determine a domainname.


troymc
Back to top
View user's profile Send private message
runningwithscissors
Guru
Guru


Joined: 21 Apr 2006
Posts: 454
Location: the third world

PostPosted: Sat May 13, 2006 11:09 am    Post subject: Reply with quote

troymc wrote:
Welp wrote:
Bingo! It works, thanks - how come that happened?


Because in /etc/hosts, the 1st entry is the address, the 2nd is the hostname, and everything else are just aliases.

The system looks at the 2nd entry to determine the domainname. Yours was simply: localhost.

So it could not determine a domainname.


troymc


Then this should work too, I suppose

Code:

127.0.0.1        welpServer1.01welp.co.uk      localhost
Back to top
View user's profile Send private message
TrevorCampbell
n00b
n00b


Joined: 16 Apr 2006
Posts: 15

PostPosted: Thu Jun 01, 2006 6:20 am    Post subject: resolve.conf still has empty domainname Reply with quote

I have just followed this guide and the tip at http://gentoo-wiki.com/FAQ_Setting_up_your_FQDN, but still end up with an empty domainname in resolve.conf.

My /etc/hosts
Code:
# /etc/hosts:  This file describes a number of hostname-to-address
#              mappings for the TCP/IP subsystem.  It is mostly
#              used at boot time, when no name servers are running.
#              On small systems, this file can be used instead of a
#              "named" name server.  Just add the names, addresses
#              and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12$#

127.0.0.1       kelpie5.priv.kelpie.org kelpie5 localhost.localdomain localhost


My /etc/conf.d/domainname
Code:
# /etc/conf.d/domainname

# When setting up resolv.conf, what should take precedence?
#  0 = let dhcp/whatever override DNSDOMAIN
#  1 = override dhcp/whatever with DNSDOMAIN

OVERRIDE=1

# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf
# (domain entry in /etc/resolv.conf and FQDN in /etc/hosts).
#
# DNSDOMAIN merely sets the domain entry in /etc/resolv.conf, see
# the resolv.conf(5) manpage for more info.

DNSDOMAIN="priv.kelpie.org"

# For information on setting up NIS, please see:
#   http://www.linux-nis.org/nis-howto/HOWTO/

NISDOMAIN=""


But resolve.conf is only
Code:
# Generated by dhcpcd for interface eth1
domain
nameserver 192.168.0.253


I am using an ADSL router as my DNS and DHCP server. Everything works OK for the internet but if I try to use dig or nslookup I get error:
Code:
kelpie5 ~ # dig www.google.com
dig: parse of /etc/resolv.conf failed
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Jun 01, 2006 8:51 am    Post subject: Reply with quote

Try upgrading to dhcpcd-2.0.5 as your resolv.conf was created by an earlier version.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
troymc
Guru
Guru


Joined: 22 Mar 2006
Posts: 553

PostPosted: Thu Jun 01, 2006 12:17 pm    Post subject: Re: resolve.conf still has empty domainname Reply with quote

TrevorCampbell wrote:

Code:
# Generated by dhcpcd for interface eth1
domain
nameserver 192.168.0.253



The blank domain line is the problem.

Hopefully Uberlord's suggestion will fix it, as it definitely appears to be a DHCP issue.

Or maybe you have DHCP mis-configured to send out a blank domain name. (never tried that myself, I would hope that dhcpd would complain though.)



troymc
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Jun 01, 2006 1:48 pm    Post subject: Re: resolve.conf still has empty domainname Reply with quote

troymc wrote:
Or maybe you have DHCP mis-configured to send out a blank domain name. (never tried that myself, I would hope that dhcpd would complain though


Sending a space in a DNS domain name is invalid.
Some people do it to have multiple search domains, but it is still invalid.

However, no dhcp client in portage checks if the supplied DNS name is valid or not - we just use what the DNS server tells us too assuming that the server is correct.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum