LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-14-2003, 11:52 AM   #1
Penguin666
LQ Newbie
 
Registered: Nov 2003
Location: Montreal Canada
Distribution: Mandrake 9.2
Posts: 17

Rep: Reputation: 0
hostname <Mandrake 9.2>


Hello.

I have just jumped from Redhat 7.2 to Mandrake 9.2

Where the h-e-double hockey sticks is the /etc/hostname file where you give the computer a hostname.

Please do not confuse this to the hosts file where you do resolution.

I can't even find /etc/sysconfig/network path.
There is /etc/sysconfig/networking???

Anyone know where the file is located. I have managed to do it using the hostname command and via the GUI, but I would really like to know how to do it manually?

Thanks.
 
Old 11-14-2003, 04:54 PM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
This is from /etc/rc.d/rc.sysinit and is how HOSTNAME get set at bootup.

Code:
HOSTNAME=`/bin/hostname`
if [ -f /etc/sysconfig/network ]; then
    . /etc/sysconfig/network
else
    NETWORKING=no
fi
If you look in /etc/sysconfig/network you should have a line like HOSTNAME=spongebob
So when you source that file e.g. . /etc/sysconfig/network that sets the HOSTNAME variable.

Now man hostname does mention /etc/hostname but also mentions /etc/hosts.
 
Old 11-21-2003, 09:51 PM   #3
Dr. Ephemeron
Member
 
Registered: Oct 2003
Distribution: Mandrake 10.1 & Fedora Core 4
Posts: 84

Rep: Reputation: 15
I added HOSTNAME=Tokyo to /etc/sysconfig/network and it says setting hostname to Tokyo when it boots up, but I still get dhcppc4 as the hostname.

I have seen a dozen explanations on what the problem is and how to fix this, and none of them work.

Last edited by Dr. Ephemeron; 11-21-2003 at 09:59 PM.
 
Old 11-22-2003, 08:56 AM   #4
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
Dr. Ephemeron
Some ISP's will give you their own hostname when you logon. It looks like that may be your problem. I don't know if there is anything you can do about that, your ISP might not work properly if you don't use their hostname. You might contact them and see if this is what they are doing.
 
Old 11-22-2003, 10:31 AM   #5
Dr. Ephemeron
Member
 
Registered: Oct 2003
Distribution: Mandrake 10.1 & Fedora Core 4
Posts: 84

Rep: Reputation: 15
Nope It's not that. MDK 9.2 gets mussed up when you install it and choose DHCP. I configured it STATIC and then switched back to DHCP and it workes now with only HOSTNAME=Tokyo.dl in the /etc/sysconfig/network file.

When I tried it before and rebooted, it would say on the bootup screen that it was setting it to Tokyo.ld, but when the prompt came up it was being assigned dhcppc2. It looks like that was being assigned by my router.

Now it works ok and I just added Tokyo.ld to Hosts like this 127.0.0.1 localhost Tokyo.ld and all is well.

Thanks



P.S. to anyone reading this, I must have seen a dozen people suggest changing line 30 in /etc/rc.d/rc.sysinit, so that it says HOSTNAME=Tokyo.ld. That is some bad advice.

Last edited by Dr. Ephemeron; 11-22-2003 at 10:43 AM.
 
Old 11-22-2003, 04:00 PM   #6
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
Quote:
P.S. to anyone reading this, I must have seen a dozen people suggest changing line 30 in /etc/rc.d/rc.sysinit, so that it says HOSTNAME=Tokyo.ld. That is some bad advice.
I would agree. Anytime you change the hostname you need to check both /etc/hosts and also /etc/sysconfig/network.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mandrake 10.1 --- Linuxant drivers problem (?)and a hostname question reflection666 Linux - Newbie 3 11-24-2004 02:33 PM
hostname mikpos Linux - Newbie 9 08-27-2004 02:38 PM
Mandrake Sets Hostname Before Getting IP? mac_phil Mandriva 1 09-30-2003 09:41 AM
Hostname _maco_ Linux - General 3 07-07-2003 07:44 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM


All times are GMT -5. The time now is 10:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration