mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-11-15 20:55:34 +08:00
7b8d608019
* Stable comparison of metadata (#239) Iterating over a map in Go never produces twice the same ordering. Thus when comparing two metadata map with more than one key, the `differ` is always finding differences. To properly compare records metadata, we need to iterate the maps in a deterministic way. Signed-off-by: Brice Figureau <brice@daysofwonder.com> * Support for Route53 ALIAS record type (#239) Route53 ALIAS doesn't behave like a regular ALIAS, and is much more limited as its target can only be some specific AWS resources or another record in the same zone. According to #239, this change adds a new directive R53_ALIAS which implements this specific alias. This record type can only be used with the Route53 provider. This directive usage looks like this: ```js D("example.com", REGISTRAR, DnsProvider("ROUTE53"), R53_ALIAS("foo1", "A", "bar") // record in same zone R53_ALIAS("foo2", "A", "blahblah.elasticloadbalancing.us-west-1.amazonaws.com", R53_ZONE('Z368ELLRRE2KJ0')) // ELB in us-west-1 ``` Unfortunately, Route53 requires indicating the hosted zone id where the target is defined (those are listed in AWS documentation, see the R53_ALIAS documentation for links).
1.1 KiB
1.1 KiB
layout | title |
---|---|
default | ALIAS Records |
ALIAS Records
ALIAS records are not widely standardized across DNS providers. Some (Route 53, DNSimple) have a native ALIAS record type. Others (Cloudflare) implement transparent CNAME flattening.
DNSControl adds an ALIAS record type, and leaves it up to the provider implementation to handle it.
A few notes:
- A provider must "opt-in" to supporting ALIAS records. When registering a provider, you specify which capabilities you support. Here is an example of how the cloudflare provider declares its support for aliases:
func init() {
providers.RegisterDomainServiceProviderType("CLOUDFLAREAPI", newCloudflare, providers.CanUseAlias)
}
- If you try to use ALIAS records, all dns providers for the domain must support ALIAS records. We do not want to serve inconsistent records across providers.
- CNAMEs at
@
are disallowed, but ALIAS is allowed. - Cloudflare does not have a native ALIAS type, but CNAMEs behave similarly. The Cloudflare provider "rewrites" ALIAS records to CNAME as it sees them. Other providers may not need this step.
- Route 53 requires the use of R53_ALIAS instead of ALIAS.