Networking Forums

Networking Forums > Computer Networking > Linux Networking > New to linux and confused about changing the hostname

Reply
Thread Tools Display Modes

New to linux and confused about changing the hostname

 
 
Patrick Shroads
Guest
Posts: n/a

 
      02-16-2004, 04:07 AM
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
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      02-16-2004, 04:29 AM
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
(E-Mail Removed)lid in Message ID box

 
Reply With Quote
 
Paul DeWolf
Guest
Posts: n/a

 
      02-16-2004, 08:17 PM
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
 
Syam
Guest
Posts: n/a

 
      02-17-2004, 05:05 AM
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the hostname in linux guddu Linux Networking 3 06-23-2008 12:24 PM
MN700, Linux and Hostname MP Broadband Hardware 2 07-02-2004 01:38 AM
changing linux hostname without rebooting Tony Linux Networking 8 10-10-2003 11:42 AM
Problem with Hostname changing to IP Address Nathan Given Linux Networking 6 09-17-2003 02:37 PM
Wrong posting: Changing Hostname made my Linux Box go crazy, Correction here N.K. Linux Networking 2 08-15-2003 01:20 PM



1 2 3 4 5 6 7 8 9 10 11