LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   hostname <Mandrake 9.2> (https://www.linuxquestions.org/questions/linux-networking-3/hostname-mandrake-9-2-a-115990/)

Penguin666 11-14-2003 11:52 AM

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.:study:

/bin/bash 11-14-2003 04:54 PM

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.

Dr. Ephemeron 11-21-2003 09:51 PM

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.

/bin/bash 11-22-2003 08:56 AM

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.

Dr. Ephemeron 11-22-2003 10:31 AM

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. :p

/bin/bash 11-22-2003 04:00 PM

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.


All times are GMT -5. The time now is 07:41 AM.