是否可以将域的dns镜像到其他域?

分享于 

分钟阅读

 
点击句子查看译文 显示原文      显示译文      双语对照    源址


Question :

Suppose i acquired both a.com and b.com two domains.the goal is when i config somepage.a.com point at a IP address, somepage.b.com can also resolved to this address.that means any lookup to *.b.com will be the same to *.a.com

As i consider, maybe some DNS provider offers something like automatic DNS mirror?or is there a way to use *.a.com for *.b.com DNS resolve?


Answer 1 :

You can use the slightly uncommon RFC 6672DNAME DNS record which provides redirection for a subtree of the domain name tree in the DNS.that is, all names that end with a particular suffix are redirected to another part of the DNS.

A DNS record :


example.com. IN DNAME example.net. 



will redirect :


a.example.com. --> a.example.net.


b.example.com. --> b.example.net. 


c.d.example.com. --> c.d.example.net.


etc. 



You will only need to manually maintain every record for example.com. that exists at the same level as the DNAME record :


example.com. IN SOA ns1.example.com. username.example.com. ( 


 20140218131405 ; Serial number YYYYMMDDHHMMSS


 28800 ; Refresh 8 hours


 7200 ; Retry 2 hours


 604800 ; Expire 7 days


 86400 ; Minimum TTL 1 day )


example.com. IN NS ns1.example.net. ; ns1.example.net is a primary nameserver


example.com. IN NS ns2.example.net. ; ns2.example.net is also a nameserver


example.com. IN MX 10 mail.example.net. ; mail.example.net is the mailserver


example.com. IN MX 20 mail2.example.net. ; the secondary mailserver


example.com. IN A 192.0.2.1 ; IPv4 address for the bare domain


example.com. IN AAAA 2001:db8:10::1 ; IPv6 address for the bare domain


example.com. IN DNAME example.net. ; every record <something>.example.com will 


 ; get mapped to <the same something>.example.net.



Please note that the RFC lists some issues, which may of import to you too.
Also, i'm not sure if you can have exceptions in the example.com zone file for records which should not get mapped to the corresponding example.net record, i.e. if the presence of a record such asold-www.example.com. IN A 192.0.2.2will continue to work and will be preferred to the DNAME mapping ofold-www.example.com. --> old-www.example.net.


Answer 2 :

There's no reason why two different domain names can't point to the same IP address.

Conceptually, just configure the dns server for b.com to have all the same data as the server for a.com if it was a small domain and you were manually updating dns data files, it would be simple to add the same records to two different files.

Whether it can be done automatically depends on the details - are the same dns servers being used for both domains?who's running the servers? Assuming it's the same provider, it could be very easy to do, but only if the provider supports it.


Answer 3 :

I don't think a DNS mirror service exists because it has a limited use case however, with amazon route 53, you can write a powershell script to create domain records for all your zones.Check out this script which will create a cname for all your hosted zones.you could use this as a template where it inputs one A records and then creates that record for both domains.



DOM  DNS  domain