Sign inSign up

killsnow/coredns

By killsnow

Updated over 3 years ago

Builds from offical source file, nothing changs, but you can use x86-64 and arm64 images.

Image
0

1.1K

killsnow/coredns repository overview

Compiled use offical source, nothing changs. But you can use x86-64 and arm64 images.

Offical Resource

Github: https://github.com/coredns/coredns
Slack: #coredns on https://slack.cncf.io
Website: https://coredns.io
Blog: https://blog.coredns.io
Twitter: @corednsio

Useage: Build DNS Server

Method1: docker-compose

  1. File structure
coredns
├── config
│   ├── Corefile
│   └── db.example
└── docker-compose.yml
  1. docker-comose.yml
version: "3.1"
services:
  web:
    image: killsnow/coredns:1.10.1
    restart: unless-stopped
    command: "--conf /root/Corefile"
    volumes:
     - ./config:/root
    ports:
     - 53:53/udp
  1. config/Corefile ( You can replace forward address use your enterprise dns server. )
.:53 {
    forward . 8.8.8.8 9.9.9.9
    log
    errors
}

example.com:53 {
    file /root/db.example
    log
    errors
}
  1. config/db.example (Domain Database file, you can replace example.com use you own domain name, not contain www. )
$ORIGIN example.com.  ; designates the start of this zone file in the namespace
$TTL 1h               ; default expiration time of all resource records without their own TTL value
@                 IN  SOA     ns.example.com. rtiger.example.com. (
                                  2020010510     ; Serial
                                  1d             ; Refresh
                                  2h             ; Retry
                                  4w             ; Expire
                                  1h)            ; Minimum TTL
@                 IN  A       192.168.1.20       ; Local IPv4 address for example.com.
@                 IN  NS      ns.example.com.    ; Name server for example.com.
ns                IN  CNAME   @                  ; Alias for name server (points to example.com.)
webblog           IN  CNAME   @                  ; Alias for webblog.example.com
netprint          IN  CNAME   @                  ; Alias for netprint.example.com
Notice

please use user own domain name replace example.com

Method2: docker run ( You need to use method1 config floder, Corefile and db.example. )

docker run --name coredns -d -p 53:53/udp -v $PWD/config:/root killsnow/coredns

Useage: DNS Client Settings

Linux/MacOS

vi /etc/resolv.conf

nameserver 192.168.1.254

Tag summary

Content type

Image

Digest

sha256:3af5d11ea

Size

13.7 MB

Last updated

over 3 years ago

docker pull killsnow/coredns