[X-Unix] Beginners questions on Unix Mail

James Bucanek subscriber at gloaming.com
Mon Dec 20 08:08:26 PST 2004


kim wrote on Monday, December 20, 2004:

>I am a complete beginner in Unix and I am trying to understand how to 
>send and receive email.

First of all, you're on the wrong track.  Sending and recieving mail has little to do with your machine (domain) name.

But since you asked....

>First off, where does the Hostname come from? By that I mean, how is it 
>generated? Mine begins with the IP address, is followed by a bit I 
>don't understand, and ends with the domain name of the Internet Service 
>Provider.

Let me guess: You're using DSL or Cable.

There are two kinds of domain name lookups: forward and backwards.  A forward lookup take a domain "name" and turns it into an IP address.  This is how www.apple.com is turned into '17.112.152.32'.  A reverse lookup takes a number and turns it into a name.

Former is provided by the global network of domain name servers.  The later is provided by each entity that owns/controls each block of IP addresses on the Internet.  Providing reverse lookup is optional and not at all a requirement.  However, many ISPs integrate their DHCP/PPP servers so that a reverse machine name is generated automatically when your computer is assigned it's IP address.  This allows both forward and reverse domain name lookups for your node.

>The start and end make sense to me, but where does that middle bit come 
>from?

From your ISP.

>Does it mean anything in particular?

Yes.  The top and second level domains are the ones belonging to your ISP.  Your ISP can only generate machine names within the domain(s) that they own, and only for the IP address blocks that they own.  The lower levels are entirely within the domain of your ISP and they can define them however they see fit.

>And can I change it?

No.

...

Now, getting back to mail.  You don't send mail directly to or from machine names, so your questions about domain names are somewhat pointless.  You send mail to a high level domains (i.e. abc at xyz.org).  That high level domain ('xyz.org') is looked up in the global domain name system and a special MX (Mail Exchange) record is obtained.  That MX record tells the mail transport agent the actual machine name of the computer that handles the mail for that domain.

You should be able to send mail from your UNIX tools.  Although many ISPs block access to mail servers outside their domain, so you may have to configure your system to relay all mail to the SMTP server provided by your ISP.

Receiving mail is a whole other world.  To receive mail you need to register a domain, set the MX record for that domain to your machine, then have an SMTP server running at that address.  This is usually a moot point because most ISPs these days block the incoming SMTP port (25).  So even if you could get all of the domain name and server stuff set up, it still wouldn't work as your ISP would block all incoming mail traffic.

If you're interested in this stuff, I'd suggest getting a good O'Reilly book on mail.  It sounds simple (just start up a mail server and the mail will start poring in).  But in reality, it's a complex problem.  Not only can it be complicated to set up, but there's a better than even chance that it's not even possible on your machine.

-- 
James Bucanek <mailto:privatereply at gloaming.com>


More information about the X-Unix mailing list