LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-28-2006, 04:31 PM   #1
tommy916
LQ Newbie
 
Registered: Oct 2003
Posts: 6

Rep: Reputation: 0
setup domains in /etc/hosts


I have a new dedicated server. In the file /etc/hosts

Should I set to

Code:
127.0.0.1     yourdomain.com   localhost.localdomain  localhost
or

Code:
127.0.0.1          localhost.localdomain   localhost
123.456.789.1      yourdomain.com
 
Old 07-28-2006, 05:19 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,083

Rep: Reputation: 799Reputation: 799Reputation: 799Reputation: 799Reputation: 799Reputation: 799Reputation: 799
What you're doing in /etc/hosts is adding the name and address of other systems that this system can get to by name (with ssh and the like). You do not want to add anything to the localhost line (never ever, just leave it be). So, if your other system is named foo.bar, your hosts file would look like this:

127.0.0.1 localhost
123.456.789.1 foo.bar foo

That way you can refer to foo.bar as simply foo; e.g., ssh foo, or with the full name, ssh foo.bar
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub Domains & Virtual Hosts oO_SwooP_Oo Linux - General 11 09-21-2005 02:07 PM
webalizer setup for virtual hosts intranet_man Linux - Security 1 03-03-2005 12:00 PM
Hosts / domains / IPs / Vhosts Belize Linux - Networking 1 08-22-2003 01:20 AM
setup multi domains email in postfix importboy03 Linux - Software 1 04-29-2003 04:06 PM
PostFix multipe domains (virtual setup) dulaus Linux - Networking 0 10-10-2002 04:58 PM


All times are GMT -5. The time now is 07:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration