#1  
Old 23rd October 2005, 22:38
n!x n!x is offline
Junior Member
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editing /etc/hosts

I'm trying to set up a mail server using this guide.

But i'm a bit confused about the /etc/hosts. Here's what's confusing me:

Code:
                    (1)                         (2)                     (3) 
              192.168.0.100             server1.example.com            server1
(1) The first thing is my LAN IP address which is 10.0.0.2 on my server.

(2) The next thing is confusing. Let's say i'm hosting this domain on my Ubuntu box www.123.com and my mailaddress should look something mail@123.com.
What should the "server1.example.com" look like in my case?

(3) This make a bit sense to me (alias, wright?)

Thanks - hope not that this is a too stupid question

/n!x
Reply With Quote
Sponsored Links
  #2  
Old 24th October 2005, 00:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Quote:
Originally Posted by n!x
(2) The next thing is confusing. Let's say i'm hosting this domain on my Ubuntu box www.123.com and my mailaddress should look something mail@123.com.
What should the "server1.example.com" look like in my case?
This has nothing to do with the domains you want to host on your server. You can still use server1.example.com or server1.123.com or h6535.anyotherdomain.com.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 25th October 2005, 00:34
themachine themachine is offline
Senior Member
 
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

The /etc/hosts file simply maps IPs to hostnames. If you look in your '/etc/nsswitch.conf' file, you'll see lines similar to:

Code:
hosts: files dns
ip_nodes: files dns
networks: dns
...etc. So, looking at that example... if you ping a host it will look for the hostname in /etc/hosts first, and if it doesn't find anything it will query dns.

To answer your question, 'server1.example.com' and 'server1' are both hostnames that point to 192.168.0.100. You could list as many names as you like this way. So I could 'ping server1' and it will ping 192.168.0.100... or I could 'ping server1.example.com' and it will also ping 192.168.0.100.
__________________
themachine
5dollarwhitebox.org
Reply With Quote
Reply

Bookmarks

Thread Tools
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


All times are GMT +2. The time now is 10:44.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.