1、安装

wget https://github.com/coredns/coredns/releases/download/v1.4.0/coredns_1.4.0_linux_amd64.tgz

2、启动

touch Corefile
vi Corefile
# vi Corefile
. {
    proxy . 223.5.5.5:53 223.6.6.6:53 {
        protocol dns
        policy round_robin
    }
    #hosts
    reload 10s
    #loadbalance round_robin
    prometheus
    errors
    log
}
./coredns -conf Corefile -dns.port 1053
# http://127.0.0.1:9153/metrics
# 测试
dig +short -p 1053 @127.0.0.1 baidu.com
dig +noall +answer AAAA -p 1053 @127.0.0.1 youku.com

3、DNS记录类型

  • A (Host address)
  • AAAA (IPv6 host address)
  • ALIAS (Auto resolved alias)
  • CNAME (Canonical name for an alias)
  • MX (Mail eXchange)
  • NS (Name Server)
  • PTR (Pointer)
  • SOA (Start Of Authority)
  • SRV (location of service)
  • TXT (Descriptive text)

4、DNS SRV

5、参考