Multiple A or CNAME?

Bill Moseley moseley at hank.org
Sat Jun 3 22:26:18 UTC 2000


I shouldn't post questions before coffee, sorry.  Please let me start over...

I'm mixed up about when to use CNAMEs when I have two names pointing to the
same IP number.

Say I have a machine called 'hal' in the domain 'example.com'.  I'd like
people to be able to lookup it's IP number a number of ways: 'example.com',
'www.example.com', and 'hal.example.com'.

This is the setup I'm currently using, but I'm unclear about when to use
the CNAME.

@ORIGIN example.com

        IN A     123.123.123.1
hal     IN A     123.123.123.1  ; CNAME or A?
www     IN CNAME hal

Should hal also be a CNAME even though it's the name of the machine?

I also want to have names like ns1.example.com, and smtp.example.com, so
that I can change IP numbers in the future yet not have to change client
configurations.

Again, I'm not sure to use A or CNAME records.


@ORIGIN example.com

        IN A     123.123.123.1
hal     IN A     123.123.123.1  ; CNAME or A?
www     IN CNAME hal

        IN NS ns1
ns1     IN A  123.123.123.1

        IN MX hal ; mx must point to A only

smtp    IN A hal  ; CNAME or A?

In other words, I'm running most of my services on one machine, but want to
be ready to move some to other machines without having to change client
configurations.

One last question.  I have an internal 192.168.0.x LAN.  If there any
reason not to place internal machines in the above zone file?

That is, any reason I can't add this to the above zone file?

inside    IN A 192.168.0.2

Looking up hal.example.com    => 123.123.123.1
           inside.example.com => 192.168.0.2

Any problem with this other than people won't be able to reach that
'inside' machine?

Thanks, and sorry for the basic questions...

Bill Moseley
mailto:moseley at hank.org



More information about the bind-users mailing list