LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Unclear on Hostnames (https://www.linuxquestions.org/questions/linux-general-1/unclear-on-hostnames-22366/)

DeadPuddle 06-01-2002 11:13 PM

Unclear on Hostnames
 
What is the purpose of a hostname? What is the hostname format? Thanks.

Psycho 06-02-2002 12:23 AM

The hostname is your computer name.

If you had Apache running and had another PC on a LAN, the other PC would be able to browse your web page with
Code:

http://your_computer_name
It's also used to be able to connect to your computer for NFS shares (network file system) or Samba shares (smb, Server message block I believe, that's what windoze uses).

The full hostname is hostname.domain_name, localdomain for the majority of folks, or you can use the 'workgroup' name if you're on a lan with windoze boxen. Or the NT domain if you're sharing the LAN with an NT domain. Or you can just make up a domain name, just leave the .com or .org off just to be safe.

<edit>Special characters should be avoided except for a dash, and computer names are limited to 15 characters in the Windoze world. I don't know what the maximum length is for a 'Nix box'.</edit>

hth

DeadPuddle 06-02-2002 01:02 AM

So, computer name=Darren, workgroup=workgroup, therefore, hostname=darren.workgroup?

Psycho 06-02-2002 02:22 AM

Could be, assuming there's windows boxen in the workgroup workgroup. You could set your domain to workgroup in the control panel - network thingy assuming you're using KDE. Back when I was monkeying with RH I used linuxconf for setting that stuff. I don't even know how to set the domain using Libranet. Mine's probably localdomain, but no more than I'm networking I don't even worry about it anymore.

But yeah, then your hostname would be darren.workgroup and that's usually alaised back to just darren in your hosts file. hosts only applies if you're using static (assigned) IPs. If you're using dhcp on the lan, then you're ahead of me.

There's only 4 PCs on my lan so I just assigned them.

With a little luck someone will jump in here tomorrow and explain it better than I have ;)

DeadPuddle 06-02-2002 03:07 AM

Well, I'm not doing it for networking purposes. I get my connection (cable modem) through a LAN. All the other PCs run Microshaft though. But if I'm getting errors, need to fix it.

DeadPuddle 06-02-2002 03:15 AM

Yes, I am configured for DHCP at boot.

Chooco 06-02-2002 04:39 AM

the hostname doesn't seem to make any sense to me, why would each computer need it's own hostname if it is not defined as part of the "network", i took my Linksys router off because it's a piece of crap and put a hub on....so my Linux box has a different IP than my Windows box is...
they can't connect to each other as part of the same network so why does it not even attempt to use my ethernet card if i don't have a host name?

DavidPhillips 06-02-2002 06:17 AM

I think we are confusing some different issues here.

What is the problem you are having?

Noerr 06-02-2002 07:09 AM

easiest way to change hostname is to run
hostname MynewName
but that won't stay until next reboot

DavidPhillips 06-02-2002 09:10 AM

1.

echo yourhostname > /etc/HOSTNAME

2.

/etc/sysconfig/network
HOSTNAME=yourhostname

3.

/bin/hostname yourhostname


All times are GMT -5. The time now is 12:18 AM.