Fedora Linux Support Community & Resources Center
Old 4th November 2006, 11:36 PM
bhm8hwcm Offline
Registered User
Join Date: Nov 2006
Posts: 14
Proper hostname

I am not sure what the proper naming convention for the hostname should be.

I will be hosting 2 websites - www.web1.com, www.web2.com

My hostname right now is localhost.localdomain
Should I leave this or change it? If I want to call my computer 'server', is my hostname therefore just 'server', or should it be 'server.localdomain'... or should it be 'server.web1.com'?

If hosting more than 1 website should any of hosted site domains be included in any of the naming conventions?

As well, if my linux box has a hostname of 'server' then what should the entry in the /etc/hosts file be? I have seen different things posted. localhost.localdomain localhost server
- or - localhost.localcomain localhost
xxx.xxx.xx.xx server

Any clarification would be appreciated. I am having a difficult time trying to nail this down. I have tried different things and my server seems to work, my mainn problems are regarding mail and I think they may be tied to this.
Reply With Quote
Old 4th November 2006, 11:44 PM
Seve Offline
Retired Community Manager
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 59
Posts: 12,371
No expert, however I would think that if you server is named server then you should see in your host file localhost.localdomain localhost server
or server localhost.localdomain localhost
also you should have
xxx.xxx.xx.xx server
for dns resolution issues etc.

Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
Old 5th November 2006, 09:13 AM
vinbob Offline
Registered User
Join Date: May 2006
Location: Hampshire, UK
Posts: 149
In other words you can replace that line with something like this... myserver myserver.web1.com myserver.web2.com

You can (or should) also have a similar line with the same host names but starting with your NIC's IP address.
Reply With Quote
Old 5th November 2006, 09:17 AM
bhm8hwcm Offline
Registered User
Join Date: Nov 2006
Posts: 14
Do you not have to have the localhost.localdomain entry in there for

I thought this was always needed, or is atleast safe.
Reply With Quote
Old 5th November 2006, 05:26 PM
vinbob Offline
Registered User
Join Date: May 2006
Location: Hampshire, UK
Posts: 149
No you don't need localhost although you could stick localhost on the end if you wish, the format isn't very strict, you could therefore have the format shown in my earlier post, here's a /etc/hosts mock-up for you... localhost.localdomain localhost #loopback IP address myserver myserver.web1.com myserver.web2.com #local IP address myserver myserver.anotherdomain #a second network card attached to a different network/domain myotherserver myotherserver.web1.com #another machine on the local network laptop #another machine on the 192 local network

Last edited by vinbob; 5th November 2006 at 05:37 PM.
Reply With Quote
Old 5th November 2006, 07:00 PM
bhm8hwcm Offline
Registered User
Join Date: Nov 2006
Posts: 14
Thanks vinbob.

Is the referring to the static ip I have been assigened from my ISP for the 2 hosted sites?
Reply With Quote
Old 5th November 2006, 08:17 PM
Zotter Offline
Registered User
Join Date: May 2004
Location: Central Wyoming
Posts: 640
There's a school of thought that says, in a similar situation, the machines could (should?) be named:
And those registered as their A names in DNS. Then C names added for the www and other services.

Remember, you want to name the machines, not their services. There are other mechanisms (C names, /etc/services) to name the services offered by those machines. Allows for greater flex later if you want to do other things.

/etc/hosts should have localhost.localdomain set to - same as default - not for outside connectivity, but for functions within the system. The loopback connector is used more than one would think.

If the box's external IP is - say - a quick and dirty method to deal with this is: localhost localhost.localdomain web1.com www.web1.com

Best yet, just leave /etc/hosts alone, at it's default setup and add the IPs, names C names and MX records for each box to your local DNS server. Special if you get more than about 5 boxes going - that's worth the trivial effort it takes to setup DHCP and DNS for your LAN.
If it ain't broken - you're not really trying....
Registered Linux user #227845
Reply With Quote

hostname, proper

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The proper way to do NFS /home savage Servers & Networking 1 25th April 2009 03:26 PM
Let's give a proper welcome. techmatt Wibble 26 6th March 2008 07:38 PM
hosts puzzle ->host hostname -> host hostname not found alphonsebrown Servers & Networking 2 30th March 2005 10:26 AM
Fedora Core 3 Hostname Error (Windows cannot ping 'hostname') 3K Tech Servers & Networking 1 3rd January 2005 04:24 AM
Help Proper NFS setup... unix_eng Servers & Networking 4 20th November 2004 12:49 AM

Current GMT-time: 12:12 (Wednesday, 23-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat