Can DNS & POP3 on the same server?

Jim Reid jim at rfc1035.com
Sun Jul 2 23:46:20 UTC 2000


>>>>> "DanO" == DanO  <express at fastdial.net> writes:

    DanO> Anyway that wasn't the original posters question.  Again if
    DanO> I'm not mistaken, the easy fix is for you to Alias your
    DanO> network card to a couple different IP's.  Have 1 for DNS, 1
    DanO> for the pop3d connection, and 1 for the machines hostname.

This may well work, but it is a needless waste of precious IP address
space. A host should normally only need to have exactly one IP address
per network interface. [Let's ignore the complication of IPv6.] You
could have multiple names (ie DNS A records) for each interface
address. Better still is to have aliases (CNAME records) for services
pointing at the hostname providing the service. ie:

	hostname.example.com. IN A 10.11.12.13
	pop.example.com. IN CNAME hostname.example.com.
	www.example.com. IN CNAME somehost.someisp.net.
	example.com. IN NS ns0.example.com.
	ns0.example.com. IN A 10.11.12.13

In other words, hostname.example.com has IP address 10.1.12.13.
pop.example.com is a nickname (alias) for hostname.example.com.
Presumably hostname.example.com runs the site's POP server. The
site's web server is provided elsewhere at somehost.someisp.net.
ns0.example.com is a name server for example.com. It has address
10.11.12.13. Targets of NS records must have A records. They can't
have CNAMEs. It would have been OK to make hostname.example.com the
target of that NS record. But since most people use the convention of
ns?.domainname for their NS records, an A record for ns0.example.com
was provided above. This is perfectly fine as far as the DNS is
concerned. It doesn't care how many names - CNAME or A records - map
to the same IP address. There should be exactly one PTR record to map
the IP address to the "real" hostname, but the DNS doesn't care about
that either.

Where you can have problems is when there is confusion over the real
name of the host. Suppose hostname.example.com ran sendmail and this
was the real name of the host returned by gethostname(2) and by a
reverse lookup of 10.11.12.13 in the DNS. If the MX records for
example.com pointed at ns0.example.com or www.example.com - ie:
	example.com. IN MX 100 ns0.example.com.
or
	example.com. IN MX 100 www.example.com.
sendmail will generate this "I refuse to talk to myself" message.

This happens because sendmail looks up example.com's MX records in the
DNS. They tell it to deliver mail for example.com to ns0.example.com
or www.example.com. Since neither of these names are the same as its
own hostname, sendmail on hostname.example.com opens a TCP connection
to www or ns0 and then finds that it's talking to itself. The solution
in this case would be to do the Right Thing and point the target of
the MX records at the real name of the system providing mail service
for example.com. ie:
	example.com: IN MX 100 hostname.example.com.

In fact, MX targets are not allowed to be CNAMEs for this very reason.
That reason is to prevent mail from looping back on itself by having
it delivered it to the sending system, not some quirk of sendmail.



More information about the bind-users mailing list