LoginSignup
0
0

CoreDNSを構築する

Posted at

ファイル構造

  • docker-compose.yml
  • Dockerfile
  • volumes
    • config
      • Corefile
      • hosts

docker-compose.yml

version: '3.1'
services:
  coredns:
    build: .
    container_name: coredns
    restart: always
    expose:
      - '53'
      - '53/udp'
    ports:
      - '53:53'
      - '53:53/udp'
    volumes:
      - './volumes/config:/etc/coredns'

Dockerfile

FROM coredns/coredns:1.7.0

EXPOSE 53
EXPOSE 53/udp

ADD volumes/config/ /etc/coredns/

ENTRYPOINT ["/coredns"]
CMD ["-conf", "/etc/coredns/Corefile"]

Corefile

. {
    whoami
    forward . 172.24.2.51:53
    errors
    log . "{proto} {remote} is Request: {name} {type} {>id}"
    hosts /etc/coredns/hosts {
        fallthrough
    }
    reload
}

hosts

172.24.20.25 kakocloud.tmcit.sho
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0