what is the use of the hostname on a home network?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
what is the use of the hostname on a home network?
-----------
quick posting topic disclaimer: I read the networking sticky and I wasn't sure if this belongs in networking or not. If not, my apologies - please move to the correct spot.
-----------
I have a home network with 2 Windows Comptuers, 2 Linux Boxen, and a BSD HTTP Server.
My BSD server's hostname was required to be its outside hostname as it is accesible via the outside. When my server used to be on Linux it didn't seem to care, but it matters on BSD. Fine - that's ok with me. So it's called server.ericsbinaryworld.com
My two linux boxes are called short-e.localdomain (for the small eMachine) and printman-ee.localdomain (for my print server). My MAIN question is, what does it matter what I call these boxen? They are not running HTTP, mySQL, etc. short-e is just my everyday desktop where I do my every day stuff. printman-ee is just running CUPSD, Samba daemon so that Windows can use the printer too, and an NFS daemon to share an external hard drive with short-e. If it matters, short-e is FC6 and printman-ee is Debian Etch.
Does it even matter if they are both on localdomain? Does that affect their ability to see each other?
Also, if I decided to change their names, does that affect smb, nfs, or cupsd? Let's say I decide today to change them to mario.mushroomkingdom and luigi.mushroom kingdom and then, two weeks from now, I decide that what I really love is HG2G and change it to fordprefect.hitchhiker and trilian.hitchhiker. Do I now have a lot of things to reconfigure?
Can I do something like ssh printman-ee.localdomain? It doesn't work now - what would I need to do to make it work? Do I need to run local DNS or something?
I know that was a ton of questions, but, try as I might today I couldn't think of a search term that would answer these questions. I got VERY, VERY close, but nothing seemed to be about the same questions I was asking.
In linux, 99% of the time the hostname means absolutely nothing. The only use I have found to it is knowing what box you're on in ssh. The only time that isn't true is with some mail programs. Some actually do use the "proper" host.domain name, which probably explains why some spam comes from localhost.localdomain. Apache is quite content to server any domain name you tell it to serve, and never care that its machine name is still localhost.localdomain.
I don't use printers at home or work, so I can't speak authoritatively about that, but samba identifies both the machine name and the windows network in the samba.conf file. Nfs designates the server by name or IP, but that isn't it's hostname, it is the FQDN, local hostname.domainname, IP, or a static entry in the /etc/hosts file.
The simple way to be able to issue a command like ssh printman-ee.localdomain would be simply to add printman-ee.localdomain or just printman-ee to the /etc/hosts file on the other boxes, assuming it has a constant IP address on your LAN. The other option is also good, but requires a bit more work, and that is to set up a local DNS server. If you don't have either static addresses on the machines or static maps for them in the DHCP device on your LAN, that would be a good way to go. You would need to setup BIND with ddns functions, and then if you simply add the line
to the top of your /etc/resolv.conf, asking for printman-ee will ask the local DNS, and that will return the LAN address of the host you asked for.
With only 3 *nix hosts I'd set them to static addresses and put those in each of their hosts files, but it would also be a good exercise to get BIND up and running. Then it is a multi-hour project rather than literally 5 minutes.
Thanks for that. I think it mostly answers my questions. Just edit the hosts files (well, in Fedora I think they insist you use the GUI or it could get over-ridden) and they will be able to find each other. If I change the hostname - just change the host file. (I do have static IPs - static enough - the router always gives them the same IP address back)
For email programs that care, I use Thunderbird. I'm not sure/can't remember if sendmail is doing stuff in the background. It certainly may be doing stuff in the background for cron job emails. Do you think sendmail would barf if I changed the names?
Fedora is crap just for reasons like that. Insisting you use a GUI to edit a text file?
If sendmail is sending email to remote domains, you may need to reconfigure it once you chance the hostname. If it is just sending email to local accounts on itself, it is probably fine. Thunderbird is a client, I was speaking of mail servers. It could care less what your local hostname is.
On the linux side, everything worked just as it should. Changing the names had no deleterious effects. Windows, being Windows, had some problems with the printers. So I had to remap them with the new name.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.