New to linux and confused about changing the hostname

This is a discussion on New to linux and confused about changing the hostname within the Linux Networking forums, part of the Linux Forums category; I'm a begginer so bear with me: I've just built my first Linux box (Mandrake 9.2) and ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2004
Patrick Shroads
 
Posts: n/a
Default New to linux and confused about changing the hostname

I'm a begginer so bear with me:

I've just built my first Linux box (Mandrake 9.2) and I want to use it
as a file/print/web/database server for my Mac and Windows machines on
my home network. I am trying to figure out how to change my machine's
name because I use DHCP and so want to access the machine by name
rather than IP address. It's currently called 'localhost' which I
guess is the default. If I change it using the uname or hostname
commands it reverts back to 'localhost' after a reboot. Someone
suggested altering the /etc/hosts file but if I use DHCP so how would
I do that since the IP address could change with a reboot?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 02-16-2004
Bit Twister
 
Posts: n/a
Default Re: New to linux and confused about changing the hostname

On 15 Feb 2004 21:07:07 -0800, Patrick Shroads wrote:

> I've just built my first Linux box (Mandrake 9.2) and I want to use it
> as a file/print/web/database server for my Mac and Windows machines on
> my home network. I am trying to figure out how to change my machine's
> name


cat /etc/sysconfig/network
HOSTNAME=fw.home.invalid <----------
NETWORKING=yes
GATEWAYDEV=eth1

> Someone suggested altering the /etc/hosts file but if I use DHCP so
> how would I do that since the IP address could change with a reboot?


You can use sed to modify /etc/hosts
Do practice on a hosts file in your home directory. :)

You can create a script to test if your ip changes and warn you to change
the mac/doze boxes hosts files.

Without seeing your hookup not much can be offered.
Example suggestion.
http://groups.google.com/advanced_group_search
slrnbvs9eu.72g.BitTwister@wb.home.invalid in Message ID box

Reply With Quote
  #3 (permalink)  
Old 02-16-2004
Paul DeWolf
 
Posts: n/a
Default Re: New to linux and confused about changing the hostname

Hi Patrick,

I don't know about the Macs, but for Windows you might look at running nmbd
(available from the Samba rpm). That's what I use so that all the Windows
boxes can look up the Linux box by hostname without having to mess with the
\Windows\drivers\etc\hosts files at all.

I also wrote a script that looks up the Windows machines in nmbd and puts
them into my Linux server /etc/hosts file, but that's only necessary if you
want to look up the Windows machines by name from Linux.

The samba server (smbd) will also allow you to access files and directories
on the Linux machine through Windows explorer.

Paul DeWolf

"Patrick Shroads" <patrickshroads@hotmail.com> wrote in message
news:e4a36fb3.0402152107.316c561b@posting.google.c om...
> I'm a begginer so bear with me:
>
> I've just built my first Linux box (Mandrake 9.2) and I want to use it
> as a file/print/web/database server for my Mac and Windows machines on
> my home network. I am trying to figure out how to change my machine's
> name because I use DHCP and so want to access the machine by name
> rather than IP address. It's currently called 'localhost' which I
> guess is the default. If I change it using the uname or hostname
> commands it reverts back to 'localhost' after a reboot. Someone
> suggested altering the /etc/hosts file but if I use DHCP so how would
> I do that since the IP address could change with a reboot?
>
> Thanks!



Reply With Quote
  #4 (permalink)  
Old 02-17-2004
Syam
 
Posts: n/a
Default Re: New to linux and confused about changing the hostname

As always google it !
http://www.cpqlinux.com/hostname.html might help .
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0