Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting a hostname
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
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Mon Jun 20, 2005 2:15 pm    Post subject: Setting a hostname Reply with quote

Hi,

I stil can't get myhostname right. I use this gentoo PC intern in network. The IP(192.168.0.14) adress is automatic from dhcpd Gentoo router. After bootting i get this message.
Quote:

Azerix.unknown_domain(Linux i686 2.6.11-gentoo-r11)

End while booting is says "* You should use /etc/conf.d/hostname and not /etc/hostname".
My hostname /etc/conf.d/hostname looks like this:
Azerix

Can any one explain me how to correct this?

greets,

azerix
Back to top
View user's profile Send private message
bkunlimited
l33t
l33t


Joined: 18 Jun 2004
Posts: 672

PostPosted: Mon Jun 20, 2005 2:19 pm    Post subject: Reply with quote

set /etc/dnsdomainname with correct domain
Back to top
View user's profile Send private message
alterself.com
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 175
Location: Iowa

PostPosted: Mon Jun 20, 2005 2:45 pm    Post subject: Reply with quote

/etc/conf.d/hostname should have syntax of:
Code:
hostname=""

same deal with /etc/conf.d/domainname
Code:
dnsdomain=""

OR just configure your dns servers w/ correct reverse dns entries and make sure that this box is using that server as its primary dns host
Back to top
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Mon Jun 20, 2005 3:52 pm    Post subject: Reply with quote

alterself.com wrote:
/etc/conf.d/hostname should have syntax of:
Code:
hostname=""

same deal with /etc/conf.d/domainname
Code:
dnsdomain=""

OR just configure your dns servers w/ correct reverse dns entries and make sure that this box is using that server as its primary dns host


After chanching those files how do i update?
rc-update add domainname default? :?
Back to top
View user's profile Send private message
alterself.com
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 175
Location: Iowa

PostPosted: Mon Jun 20, 2005 6:53 pm    Post subject: Reply with quote

i started to typea list of things to restart and source , but then i figured, ...restart :)
if restart isnt a solution for you right now, restart domainname and hostname, log out and log in. that SHOULD work.
Back to top
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Mon Jun 20, 2005 7:46 pm    Post subject: Reply with quote

Restarting is not the problem. Whe i use /etc/conf.d/domainname and the restarting he is not listening to /etc/conf.d/domainname. Het automaticly cheking in /etc/hostname and /etc/dnsdomainname.

Now, my question is how kan i make him to chek /etc/conf.d/domainname?
Back to top
View user's profile Send private message
alterself.com
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 175
Location: Iowa

PostPosted: Mon Jun 20, 2005 7:48 pm    Post subject: Reply with quote

Code:
rc-update add domainname default
Back to top
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Mon Jun 20, 2005 7:52 pm    Post subject: Reply with quote

Azerix wrote:
After chanching those files how do i update?
rc-update add domainname default? :?

:? I did that long time a go, but aint working , he take automaticly /etc/hostname and /etc/dnsdomainname
Back to top
View user's profile Send private message
alterself.com
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 175
Location: Iowa

PostPosted: Mon Jun 20, 2005 7:58 pm    Post subject: Reply with quote

i am running the latest ~x86, and "sys-apps/baselayout-1.11.12-r4" removes the need for /etc/hostname and /etc/domainname in favor of entires in /etc/conf.d/hostname and /etc/conf.d/domainname.

my question is are you running ~x86 or just 'regular' x86?
Back to top
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Mon Jun 20, 2005 8:01 pm    Post subject: Reply with quote

i dont remember wich baselayout it was. How can chek that?
Back to top
View user's profile Send private message
johntramp
Guru
Guru


Joined: 03 Feb 2004
Posts: 457
Location: New Zealand

PostPosted: Mon Jun 20, 2005 8:07 pm    Post subject: Reply with quote

there is /etc/init.d/domainname and /etc/init.d/hostname. I think you need to
Code:
rc-update del domainname
rc-update add hostname boot
(or should it be default?)
Back to top
View user's profile Send private message
Azerix
Guru
Guru


Joined: 19 Dec 2004
Posts: 346
Location: NL

PostPosted: Mon Jun 20, 2005 8:09 pm    Post subject: Reply with quote

You meen i have use /etc/init.d/hostname and /etc/init.d/domainname? 8O
Back to top
View user's profile Send private message
statare
n00b
n00b


Joined: 25 Mar 2005
Posts: 28
Location: Sweden

PostPosted: Tue Jun 21, 2005 12:25 am    Post subject: Reply with quote

Hmm... have you deleted old /etc/hostname and /etc/domainname so you only have those in /etc/conf.d/ ? Thats all I did.
Back to top
View user's profile Send private message
makenoob
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 272
Location: /Germany/Düsseldorf

PostPosted: Tue Jun 21, 2005 8:44 am    Post subject: Reply with quote

Azerix wrote:
i dont remember wich baselayout it was. How can chek that?


you can use
Code:

qpkg -I -v |grep baselayout

or, if you don't have gentoolkit installed
Code:

emerge -s baselayout

where the installed und actual version will be displayed (in the latter one).

HTH
marc
Back to top
View user's profile Send private message
roymaster
n00b
n00b


Joined: 05 Jan 2003
Posts: 64
Location: Europe

PostPosted: Tue Jun 21, 2005 10:41 am    Post subject: Reply with quote

try

etcat -v baselayout

My case: [ I] 1.11.12-r4 (0)

I have
domainname in default
hostname in boot

hostname works, domainname not.

Try to add both services to boot runlevel. I will do it too LOL.
Back to top
View user's profile Send private message
statare
n00b
n00b


Joined: 25 Mar 2005
Posts: 28
Location: Sweden

PostPosted: Thu Jun 23, 2005 1:20 am    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic-t-350522.html
In short it says add your host- and domainname to /etc/hosts like this
Code:
127.0.0.1  localhost
192.168.0.1  hostname.domainname hostname

This works fine for me with hostname-command.
Code:
# hostname -f


I changed hostname and domainname when I tested and now I have a strange issue.
As I said hostname command returns right hostname and domainname but
Code:
# echo $HOSTNAME

returns an old hostname, not the new one. 8O Very strange since hostname-command returns correct name. Any ideas?

[edit]
In /etc/profile.env the wrong hostname was set. Had to manually set the new hostname. Anyway to get your hostname and domainname right you have to edit
Code:
/etc/conf.d/hostname
/etc/conf.d/domainname
/etc/hosts

If you change hostname, as I did, check /etc/profile.env
[/edit]
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1564
Location: Germany

PostPosted: Thu Jun 23, 2005 7:33 pm    Post subject: Reply with quote

After the previous update, I deleted /etc/hostname and set up /etc/conf.d/hostname with the new syntax hostname="Ma1".
But after rebooting the hostname is set to (none). With the old /etc/hostname the hostname is set correct, with the hint that I should stop using this file.

But if I do /etc/init.d/hostname restart, a lot of services are restarted with and the hostname is set correct afterwards. I don't use a domainname.
/etc/hosts has just localhost, but this worked before.
I fear every update with gentoo and etc-update :)
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
randolph
n00b
n00b


Joined: 16 Mar 2005
Posts: 10
Location: Berlin

PostPosted: Fri Jun 24, 2005 8:12 am    Post subject: Reply with quote

To Azerix

have you found a solution to
"You should stop using /etc/hostname and use /etc/cnf.d/hostname" and
"You should stop using /etc/domainname and use /etc/cnf.d/domainname"?

I have got the same "problem". In fact its not a real problem. It just makes me wonder.

Isn't there a file anywhere which points to the "/etc/conf.d/..." location at boot?

So if there is shouldn't it be easy to just set it right. And if not how can i stop using "/etc/..." and start using "/etc/conf.d/..."?

(these little yellow stars at boot...:evil: )
Back to top
View user's profile Send private message
GentooMik
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2004
Posts: 141

PostPosted: Fri Jun 24, 2005 8:14 am    Post subject: Reply with quote

You will need to delete those files in etc . You should backup first all the settings!

cp /etc/hostname <wherever backup>

cp etc/domainname <whereever backup>

rm /etc/hostname

rm /etc/domainname

it will start to use the new ones when you configured or copied the contents from old files.
Quote:


"You should stop using /etc/hostname and use /etc/cnf.d/hostname" and
"You should stop using /etc/domainname and use /etc/cnf.d/domainname"?
Back to top
View user's profile Send private message
randolph
n00b
n00b


Joined: 16 Mar 2005
Posts: 10
Location: Berlin

PostPosted: Fri Jun 24, 2005 8:39 am    Post subject: Reply with quote

easy peasy
thx alot it works perfect :)

just out of curiosity do you know where the system looks at boot?
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1564
Location: Germany

PostPosted: Fri Jun 24, 2005 10:59 am    Post subject: Reply with quote

do I need to use both? hostname and domainname?
What should the hostname look like? I just have an entry with hostname="Ma..". This doesn't work with boot up.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
GentooMik
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2004
Posts: 141

PostPosted: Sat Jun 25, 2005 9:57 am    Post subject: Reply with quote

:)

I am not sure for that one, believe it looks into some scripts. Someone who knows more in this area may be more of a help. It is like a rc.something bunch of scripts. " Most likely /etc/init.d " :idea: actually if you look at it /etc has few locations that seem to be initialized in during boot.


Quote:


easy peasy
thx alot it works perfect :)

just out of curiosity do you know where the system looks at boot?





Yes indeed you do need to have both of them .

Quote:


do I need to use both? hostname and domainname?
What should the hostname look like? I just have an entry with hostname="Ma..". This doesn't work with boot up.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1564
Location: Germany

PostPosted: Sun Jun 26, 2005 2:22 pm    Post subject: Reply with quote

ok, I got the original file by a reemerge of baselayout.
So using both /etc/conf.d/hostname and domainname works now.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|Acer Z5610 (Core2QuadQ8200),8G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
meltie
n00b
n00b


Joined: 25 Jan 2005
Posts: 8
Location: Bremen, Germany

PostPosted: Tue Jul 12, 2005 4:22 pm    Post subject: Reply with quote

Hi folks,

sorry to recycle this thread, but I still cannot convince my machine to look up my hostname and domainname in /etc/conf.d/hostname and /etc/conf.d/domainname.

The old files, /etc/hostname and /etc/dnsdomainname, are removed and my hostname is set correctly in /etc/hosts, as suggested as solution. With the old files, it works perfectly, but I don't want to have these annoying yellow stars at boot. I've modified my runlevels several times to convice my machine that I'm serious about the change :-)

When I restart the init-scripts /etc/init.d/hostname resp. domainname, it works. Just not automatically at boot. This is a small problem, but it's annoying.

Any help appreciated.

meltie
Back to top
View user's profile Send private message
Hunter555
n00b
n00b


Joined: 19 Apr 2005
Posts: 16
Location: GentooLand

PostPosted: Mon Jul 18, 2005 10:20 am    Post subject: Reply with quote

I found with using the new files I had to have an /etc/nsswitch.conf to get the dnsdomainname to work. This wasn't included in the base stage3 or baselayout. Fresh install as of yesterday. Without nsswitch I couldn't even resolve my own hostname.
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