LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   need fully qualified hostname before log-in - how? (https://www.linuxquestions.org/questions/linux-networking-3/need-fully-qualified-hostname-before-log-in-how-16111/)

BrianK 03-12-2002 01:50 PM

need fully qualified hostname before log-in - how?
 
my computer name is viking, but it needs to be viking.whatever.com (for a program I'm running). I can login as or su to root and use the hostname command, but that gets really tedious. How do I permanantly change the hostname?

kill-hup 03-12-2002 02:09 PM

Since you list your distro as RedHat, it uses the value from /etc/sysconfig/network. There should be a line in that file of the form:

Code:

HOSTNAME=viking
Just change that to "viking.whatever.com" and you should be set.

Other distros do it different ways. Slackware, for instance, sets your hostname in /etc/rc.d/rc.M
using the value in /etc/HOSTNAME (assuming there is one, otherwise it provides a default) :

Code:

/bin/hostname `cat /etc/HOSTNAME | cut -f1 -d .`
To change it here, you would remove the "-d ." or the entire pipe to cut.

Hope this helps.

finegan 03-12-2002 02:15 PM

First add the fqdn to /etc/hosts
Also, RedHat I think stores the fqdn in /etc/sysconfig/networks

The standard used to be /etc/hostname, on Debian it still is, on Slack its /etc/HOSTNAME... poke around a bit for where it is one RedHat, hopefully someone else will just "know" and post it after me.

Cheers,

Finegan

BrianK 03-12-2002 02:28 PM

Quote:

Originally posted by kill-hup
Since you list your distro as RedHat, it uses the value from /etc/sysconfig/network.
that's exactly what I was looking for. thanks.

On that note (maybe I should have made this a new thread... in another forum, but...) On another box, I have IRIX 6.5 (it's an SGI, obviously), and have no clue how to set the gateway. I noticed that the /etc/sysconfig/network file is where the gateway information is stored in RH... anyone have any clue as to where it's stored in IRIX 6.5?

finegan 03-12-2002 02:43 PM

An old SGI... mmm, cool toy!

Aside from the guess that you could hand hack it with:

route add default gw xxx.xxx.xxx.xxx

I have no idea where its stored as a config. Really, post that somewhere under General and someone is bound to reply.

Cheers,

Finegan

BrianK 03-12-2002 03:05 PM

Quote:

Originally posted by finegan
An old SGI... mmm, cool toy!

yeah... a fun toy that cost $30K in '95 and gets outperformed by a $100 graphics card today. :) Oh well, it still does its job.

Thanks for the tip on posting in the general forum.

kill-hup 03-12-2002 03:12 PM

In IRIX, I believe the routing info is stored in /etc/config/static-route.options

(for all the Solaris dudes, out there, try /etc/defaultrouter )

However, I'm not an IRIX admin - I just play one on web forums ;)

BrianK 03-12-2002 06:21 PM

FYI: I just ran the route command (to set the default gateway on IRIX):
Code:

route add default router ip 1
:)


All times are GMT -5. The time now is 06:25 AM.