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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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! |
|
|||
|
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 |
|
|||
|
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! |
|
|||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|