Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

how do I set a hostname under Linux - mandrake?

Thread Tools
 
Search this Thread
 
Old 24 March 2003, 02:47 PM
  #1  
gregh
Scooby Regular
Thread Starter
 
gregh's Avatar
 
Join Date: Dec 1999
Posts: 3,360
Likes: 0
Received 0 Likes on 0 Posts
Post

this one is driving me potty! I can do hostname fred from a command line as root, but it's not kept during a reboot. so I created /etc/hostname and put fred in there, but if I do hostname I get an answer back of .

cheers,

greg
Old 24 March 2003, 03:03 PM
  #2  
marcmann
Scooby Regular
 
marcmann's Avatar
 
Join Date: Oct 2002
Posts: 163
Likes: 0
Received 0 Likes on 0 Posts
Post

If Mandrake is similar to Redhat (and I'm not sure if it is) then type hostname fred - this will change your hostname to fred. If you then type hostname again it should say fred.

Then edit /etc/hosts file and enter:

xxx.xxx.xxx.xxx fred


The x's are the IP address of fred.


Reboot the machine and voila!


Marc
Old 24 March 2003, 03:07 PM
  #3  
gregh
Scooby Regular
Thread Starter
 
gregh's Avatar
 
Join Date: Dec 1999
Posts: 3,360
Likes: 0
Received 0 Likes on 0 Posts
Post

Hi Marc,

hostname does what you say, but it doesn't last after a reboot.

Also my IP address is selected via DHCP so I can't put a fixed IP address into host



greg
Old 24 March 2003, 03:19 PM
  #4  
marcmann
Scooby Regular
 
marcmann's Avatar
 
Join Date: Oct 2002
Posts: 163
Likes: 0
Received 0 Likes on 0 Posts
Post

Not sure then mate. Found this on a site though:

".....You need to change your hostname, and that's
all. You can do that with MandrakeControlCenter or linuxconf, just
remember to restart desktops or there will be problems...."

Sorry don't know anything about mandrake. I guess the linuxconf file should be in the /etc/folder?


Marc
Old 24 March 2003, 04:25 PM
  #5  
michael_clarkson
Scooby Regular
 
michael_clarkson's Avatar
 
Join Date: Jan 2001
Posts: 253
Likes: 0
Received 0 Likes on 0 Posts
Post

Greg,

Edit /etc/sysconfig/network file and add this.
NETWORKING=yes
HOSTNAME=replace.with.your.hostname

Old 24 March 2003, 04:27 PM
  #6  
gregh
Scooby Regular
Thread Starter
 
gregh's Avatar
 
Join Date: Dec 1999
Posts: 3,360
Likes: 0
Received 0 Likes on 0 Posts
Post

I've tried that Michael, and also set dhcp_hostname and hostname still comes back with . when I reboot

greg
Old 24 March 2003, 04:36 PM
  #7  
gregh
Scooby Regular
Thread Starter
 
gregh's Avatar
 
Join Date: Dec 1999
Posts: 3,360
Likes: 0
Received 0 Likes on 0 Posts
Post

well there's a thing, one firmware upgrade later on my router, and all is well

regards,

greg

Trending Topics

Old 24 March 2003, 04:44 PM
  #8  
michael_clarkson
Scooby Regular
 
michael_clarkson's Avatar
 
Join Date: Jan 2001
Posts: 253
Likes: 0
Received 0 Likes on 0 Posts
Post

Greg,

No idea if you've edited: /etc/sysconfig/network-scripts/ifcfg-eth0: and modified DHCP_HOSTNAME line aswell as /etc/sysconfig/network and set the HOSTNAME

The only other thing to try is check your /etc/HOSTNAME file, create it if you don't find it, it simply containd your hostname.

You could also check /etc/hosts to check you actually specify your hostname i.e

127.0.0.1 hostname.domain localhost localhost.domain hostname

[Edited by michael_clarkson - 3/24/2003 4:46:26 PM]
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
Brumguy34
Subaru Parts
8
04 October 2015 07:51 PM
blackieblob
ScoobyNet General
2
02 October 2015 05:34 PM
Ganz1983
Subaru
5
02 October 2015 09:22 AM



Quick Reply: how do I set a hostname under Linux - mandrake?



All times are GMT +1. The time now is 09:35 AM.