curl -O https://github.com/coredns/coredns/releases/download/v1.11.1/coredns_1.11.1_linux_amd64.tgz
tar -xvzf coredns_1.11.1_linux_amd64.tgz
cd coredns
ls
# → coredns
./coredns
. {
hosts /etc/hosts {
fallthrough
}
forward . 8.8.8.8
log
}
/etc/hosts 파일을 참조해 내부 도메인 이름 해석log → 질의 로그 출력fallthrough → /etc/hosts 에서 못 찾으면 다음 플러그인(forward) 실행192.168.1.10 web
192.168.1.11 db
ping web → 192.168.1.10ping db → 192.168.1.11./coredns -conf Corefile
/etc/resolv.conf 에서 CoreDNS 서버 IP 설정nameserver 192.168.1.100
/etc/hosts 파일을 참조👉 플러그인 목록 전체: https://coredns.io/plugins/
myservice.mynamespace.svc.cluster.local 형태로 서비스 이름 해석 가능kubernetes 플러그인으로 구성됨. {
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
}
forward . /etc/resolv.conf
log
cache 30
}
/etc/hosts → 빠르고 간편file 존 파일 기반으로 확장 가능kubernetes 플러그인 적극 활용