Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How change back the hostname/domainname?
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
Manymore
n00b
n00b


Joined: 17 Jul 2004
Posts: 25
Location: Phoenix, Arizona

PostPosted: Fri Sep 30, 2005 7:10 pm    Post subject: How change back the hostname/domainname? Reply with quote

On my new Gentoo system I recently did a "#emerge --update --newuse --deep world" after having changed some USE flags. This resulted in 43 config files in /etc needing to be updated. I accepted the updated config files but now my hostname and domainname have changed:

Code:
gary@localhost ~ $ hostname
localhost


Code:
gary@localhost ~ $ domainname
(none)


I followed the Gentoo Linux/x86 Handbook exactly when I did the installation and set the hostname to "tux" and domainname to "homenetwork". To change back the hostname/domainname do I simply follow the same procedure as follows?

Code:
# echo tux > /etc/hostname

Code:
# echo homenetwork > /etc/dnsdomainname

Code:
# rc-update add domainname default
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Fri Sep 30, 2005 7:15 pm    Post subject: Reply with quote

The locations where you set these have changed - it clearly told you so when you updated your configs.
Use /etc/conf.d/hostname and /domainname in the future.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
Manymore
n00b
n00b


Joined: 17 Jul 2004
Posts: 25
Location: Phoenix, Arizona

PostPosted: Fri Sep 30, 2005 7:28 pm    Post subject: Reply with quote

adaptr,

Thank you for the reply.

After I make the changes do I need to do the rc-update?
Back to top
View user's profile Send private message
Manymore
n00b
n00b


Joined: 17 Jul 2004
Posts: 25
Location: Phoenix, Arizona

PostPosted: Fri Sep 30, 2005 9:12 pm    Post subject: Reply with quote

I edited /etc/conf.d/hostname and the change worked:

Code:
gary@tux / $ hostname
tux


I then edited /etc/conf.d/domainname, did a "# rc-update add domainname default" and got the following:

Code:
tux / # rc-update add domainname default
 * domainname already installed in runlevel default; skipping


However, the domainname still comes up as "none":

Code:
gary@tux ~ $ domainname
(none)


My /etc/conf.d/domainname looks as follows:
Code:
# /etc/conf.d/domainname

# When setting up resolv.conf, what should take precedence?
# If you wish to always override DHCP/whatever, set this to 1.
OVERRIDE=1

# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf
# properly (domain entry in /etc/resolv.conf, and FQDN in /etc/hosts).
#
DNSDOMAIN="homenetwork"

# This only set what /bin/hostname returns.  If you need to setup NIS, meaning
# what /bin/domainname returns, please see:
#
#   http://www.linux-nis.org/nis-howto/HOWTO/
#
#NISDOMAIN=""


Maybe I haven't edited the file correctly. Do I need to change other config files?

I would appreciate any help. Thanks.
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sat Oct 01, 2005 11:46 am    Post subject: Reply with quote

The domainname command does not echo your DNS domain.
Use
Code:
hostname --fqdn

for that.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
Manymore
n00b
n00b


Joined: 17 Jul 2004
Posts: 25
Location: Phoenix, Arizona

PostPosted: Sat Oct 01, 2005 1:44 pm    Post subject: Reply with quote

My domainname comes up as "localhost".

Code:
gary@tux ~ $ hostname --fqdn
localhost


I have already edited /etc/conf.d/domainname to change my domainname to "homenetwork" as in my post above but the domainname is "localhost".

How can I change my domainname to "homenetwork"?
Back to top
View user's profile Send private message
Delphi
n00b
n00b


Joined: 02 Oct 2005
Posts: 14

PostPosted: Sun Oct 02, 2005 7:10 pm    Post subject: Domainname Reply with quote

I am having this exact same problem. I have set my domainname in /etc/conf.d/domainname and added domainname to the default runlevel.

When I boot my computer to linux, it displays that it is changing my domainname. My network is then brought up by dhcp, and then my log in looks like:

Delphi.(none) (i686 Linux blah blah blah)

Instead of what I chose or what is listed in /etc/resolv.conf (which is furthermore different from what I have listed in /etc/conf.d/domainname)
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Oct 02, 2005 8:13 pm    Post subject: Re: Domainname Reply with quote

Delphi wrote:
Delphi.(none) (i686 Linux blah blah blah)

This is not actually a problem, even though it looks weird. The "(none)" is caused by NIS rather than DNS being used to determine the "domain name".
Back to top
View user's profile Send private message
Delphi
n00b
n00b


Joined: 02 Oct 2005
Posts: 14

PostPosted: Sun Oct 02, 2005 8:16 pm    Post subject: Reply with quote

Is there any way that I can work around this and get it to display what I would like?
Back to top
View user's profile Send private message
lghman
Guru
Guru


Joined: 29 Nov 2002
Posts: 548
Location: Florida

PostPosted: Sun Oct 02, 2005 8:25 pm    Post subject: Reply with quote

Delphi wrote:
Is there any way that I can work around this and get it to display what I would like?

Yes there is. Follow this article here. http://gentoo-wiki.com/TIP_Setup_Your_FQDN

--sonik
_________________
"What a distressing contrast there is between the radiant intelligence of a child and the feeble mentality of the average adult" --Freud
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Oct 02, 2005 8:33 pm    Post subject: Reply with quote

sonikntails wrote:
Yes there is. Follow this article here. http://gentoo-wiki.com/TIP_Setup_Your_FQDN

That solves the cosmetic "(None)", but creates its own problems with programs that expect to be contacted by "localhost" rather than "your.domainname.com". So I recommend that you leave /etc/hosts as it should be, i.e. beginning with:
Code:
127.0.0.1       localhost blah...
Back to top
View user's profile Send private message
lghman
Guru
Guru


Joined: 29 Nov 2002
Posts: 548
Location: Florida

PostPosted: Mon Oct 03, 2005 12:24 am    Post subject: Reply with quote

PaulBredbury wrote:
sonikntails wrote:
Yes there is. Follow this article here. http://gentoo-wiki.com/TIP_Setup_Your_FQDN

That solves the cosmetic "(None)", but creates its own problems with programs that expect to be contacted by "localhost" rather than "your.domainname.com". So I recommend that you leave /etc/hosts as it should be, i.e. beginning with:
Code:
127.0.0.1       localhost blah...

I have yet to use a program that bitched to me about being able to find localhost. Which I would assume is due to the fact that you dont take the localhost out of that line, just move it backward.

--sonik
_________________
"What a distressing contrast there is between the radiant intelligence of a child and the feeble mentality of the average adult" --Freud
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Oct 03, 2005 12:41 am    Post subject: Reply with quote

sonikntails wrote:
I have yet to use a program that bitched to me about being able to find localhost. Which I would assume is due to the fact that you dont take the localhost out of that line, just move it backward.

It's true that there's not very many programs that rely on 127.0.0.1 being localhost - it's not a big problem. However, moving "localhost" back in the list in /etc/hosts does not help - either 127.0.0.1 is "localhost" or it's not - "your.company.com" is not "localhost".

Since the Linux standard for /etc/hosts seems to be to have "localhost" first in the list, I'm reluctant to change that, just to solve the cosmetic "(None)". The proper solution I think should be to calculate the "(None)" string more sensibly (although I lack the skill currently to come up with a patch for that).

Here's a newsgroup thread where this exact same problem is discussed.
Back to top
View user's profile Send private message
lghman
Guru
Guru


Joined: 29 Nov 2002
Posts: 548
Location: Florida

PostPosted: Mon Oct 03, 2005 12:53 am    Post subject: Reply with quote

PaulBredbury wrote:
sonikntails wrote:
I have yet to use a program that bitched to me about being able to find localhost. Which I would assume is due to the fact that you dont take the localhost out of that line, just move it backward.

It's true that there's not very many programs that rely on 127.0.0.1 being localhost - it's not a big problem. However, moving "localhost" back in the list in /etc/hosts does not help - either 127.0.0.1 is "localhost" or it's not - "your.company.com" is not "localhost".

Since the Linux standard for /etc/hosts seems to be to have "localhost" first in the list, I'm reluctant to change that, just to solve the cosmetic "(None)". The proper solution I think should be to calculate the "(None)" string more sensibly (although I lack the skill currently to come up with a patch for that).

Here's a newsgroup thread where this exact same problem is discussed.

I agree with you completely, and my laptop isnt set up that way as I use that box mostly for business (which in my case is consulting). My home box is set up different, but then again I actually own a domain that goes to my network. This could also be why I havent seen any of those problems. I dont believe it would cause enough issues though for the "common" user not doing anything hella fancy .... then again I could be wrong too. :)

--sonik
_________________
"What a distressing contrast there is between the radiant intelligence of a child and the feeble mentality of the average adult" --Freud
Back to top
View user's profile Send private message
daywalkerNT
n00b
n00b


Joined: 01 Oct 2005
Posts: 40

PostPosted: Mon Oct 03, 2005 5:38 am    Post subject: Reply with quote

What about this line from the HandBook (Section #8)

/etc/conf.d/net

dhcp_eth0="nodns nontp nonis"


I'm going to try it too to see what happens.
Back to top
View user's profile Send private message
IronWolve
n00b
n00b


Joined: 23 Jun 2002
Posts: 41

PostPosted: Sat Dec 03, 2005 7:46 am    Post subject: Reply with quote

Thanks for the thread, also had this issue. Just added
127.0.0.1 sexy.dyn-dns-domain sexy localhost

and that fixed it. Sounds like a bug though if dnsdomain isnt working on login.
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