Skip to content

CoreDNS plugin for replacing CNAME records on zone apex

License

Notifications You must be signed in to change notification settings

section-io/alias

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alias

The alias plugin eliminates CNAME records from zone apex by making the subsequent resolved records look like they belong to the zone apex. This behaves similarily to CloudFlare's Zone Flattening.

This plugin only works with the file middleware with upstream set, or when A or AAAA records exist alongside the CNAME record.

Preferrably, this should not be used in favour of the RFC drafts for the new ANAME records, but the DNS library used by CoreDNS does not support ANAME records yet.

Syntax

alias

Examples

example.com {
  file example.com.db {
    upstream 8.8.8.8
  }
  alias
}

All it does is transform records like this:

;; ANSWER SECTION:
example.com.	300	IN	CNAME	some.magic.example.org.
some.magic.example.org. 299 IN A	123.123.45.67

into

;; ANSWER SECTION:
example.com.	299	IN	A	123.123.45.67

Installation

$ go get github.com/coredns/coredns
$ go get github.com/serverwentdown/alias
$ cd $GOPATH/src/github.com/coredns/coredns
$ vim plugin.cfg
# Add the line alias:github.com/serverwentdown/alias before the file middleware
$ go generate
$ go build
$ ./coredns -plugins | grep alias

About

CoreDNS plugin for replacing CNAME records on zone apex

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%