Assign CNAME for one subdomain?

Barry Margolin barry.margolin at level3.com
Mon Oct 13 18:19:23 UTC 2003


In article <bmepis$old$1 at sf1.isc.org>,
Florian Effenberger <IOMJEPOJAXSA at spammotel.com> wrote:
>Hi there,
>
>I have a question regarding BIND9, hope you can help me.
>
>Assume we have a domain name (for a school) like ourschool.com. This domain
>name is hosted, and the DNS servers are at our ISP and resolve to a static
>IP of a webserver in a datacenter.
>
>Now we have an onsite internet gateway (a router) which is a local
>webserver. From within our school, it is reachable via router.school
>(.school is the internal "domain", we have own inhouse DNS servers). From
>outside, we have a dynamic DNS entry, so it resolves as router.ourschool.com
>
>Now, when someone from within our school calls router.ourschool.com rather
>then router.school, he gets connected to the external IP. However, I would
>like to have him connect to the internal IP.
>
>So, I need to set a single subdomain to a CNAME on our local DNS servers,
>like
>
>router.ourschool.com. IN CNAME router.school.
>
>However, this does not seem to work, BIND always complains. Is there any
>possibility of achieving that?
>
>In short: Our local bind should query the regular DNS for *.ourschool.com,
>EXCEPT router.ourschool.com, which should be CNAMED to router.school

Try the following.  Create a zone named "router.ourschool.com" on your
internal nameserver:

zone "router.ourschool.com"
  type master;
  filename "router.ourschool.com.db";
};

The router.ourschool.com.db file should contain something like:

@ IN SOA ...
  IN NS ns.school.
  IN A <internal IP>

Then in the .school domain, make router.school a CNAME for
router.ourschool.com (or you could just leave it as it is, so there will be
two A records that point to the same address).

-- 
Barry Margolin, barry.margolin at level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


More information about the bind-users mailing list