서비스 관리
CoreDNS 상태를 확인합니다:
systemctl status coredns
CoreDNS 재시작:
systemctl restart coredns
CoreDNS 리로드:
systemctl reload coredns
CoreDNS 중지:
systemctl stop coredns
CoreDNS 시작:
systemctl start coredns
CoreDNS 로그 보기:
journalctl -u coredns -f
DNS 구성
CoreDNS의 기본 구성은 다음과 같습니다:
/etc/coredns/Corefile
기본 구성은 DNS 쿼리를 다음으로 전달합니다:
1.1.1.1 8.8.8.8
Corefile은 구체적인 요구 사항과 사용 사례에 맞게 구성하세요.
Corefile을 변경한 후 CoreDNS를 재시작합니다:
systemctl restart coredns
DNS 엔드포인트
- DNS:
53/tcp와53/udp - 헬스:
http://127.0.0.1:8080/health - 준비 상태:
http://127.0.0.1:8181/ready - 메트릭:
http://127.0.0.1:9153/metrics
중요한 파일 및 디렉토리
- 바이너리:
/usr/bin/coredns - Corefile:
/etc/coredns/Corefile - 서비스:
/etc/systemd/system/coredns.service - Sysusers:
/usr/lib/sysusers.d/coredns.conf - Tmpfiles:
/usr/lib/tmpfiles.d/coredns.conf - Logrotate:
/etc/logrotate.d/coredns - 데이터 디렉토리:
/var/lib/coredns - 로그 파일:
/var/log/coredns.log - 오류 로그:
/var/log/coredns.err.log - 리졸버 재정의:
/etc/systemd/resolved.conf.d/99-coredns.conf
DNS 확인 테스트
CoreDNS에 직접 조회합니다:
dig @127.0.0.1 example.com
또는 서버 IP로 조회합니다:
dig @<SERVER-IP> example.com
The host's /etc/resolv.conf is configured to use:
nameserver 127.0.0.1
참고
- CoreDNS uses
systemd-resolved53번 포트를 비우기 위한 구성 변경을 수행합니다. - The host resolver is pointed to
127.0.0.1. - DNS 쿼리는 구성된 상위 리졸버로 전달됩니다.
- CoreDNS runs under the dedicated
corednssystem user.