How to use CNAME to external hosts on local DNS Server?

11,283

You do not have to create an internal zone example.com which overrides the whole domain, create an internal zone for a subdomain newserver.example.com authoritative for *.newserver.example.com and the zone name itself without any prefix i.e. newserver.example.com.

Since you're using this only in your internal DNS you have, I think, an edge case, where you don't necessarily run into this problem and can still do:

# zone for newserver.example.com.
@  IN CNAME newserver.cloudapp.net.

and don't have to do

# zone for newserver.example.com.
@  IN A  <the_ip-address_of_newserver.cloudapp.net.> 

which is the alternative.

Share:
11,283
Ederson
Author by

Ederson

Updated on September 18, 2022

Comments

  • Ederson
    Ederson over 1 year

    I have a domain mydomain.com and I'm using an external DNS Server to resolve some names like www.mydomain.com and webmail.mydomain.com on Internet.

    Now, I need to create a rule, only on my LAN, to resolve newserver.mydomain.com to newserver.cloudapp.net (a new server hosted at Azure).

    At first I tought, "I can create a CNAME entry on my local DNS Server and the job is done!" but to do it I had to create another zone to resolve *.mydomain.com and all went wrong. My DNS server was able to resolve newserver.mydomain.com but all other URLs were unavailable... of course, my local DNS server became "authoritative" for that domain.

    I'm using Windows Server 2012, and I only want to configure my DNS Server to do this:

    Resolve this entry:

    newserver.mydomain.com CNAME newserver.cloudapp.net

    and

    *.mydomain.com still resolving on external DNS Server.

    How can I do that?

    Thanks in advance! ;)

    • vautee
      vautee over 9 years
      If we're talking about resolving on one host only: Why not use your hosts file for this? :)
    • Ederson
      Ederson over 9 years
      We need resolve this name from any host in our LAN... thanks ;)