Service-Management
Prüfen Sie den Status von CoreDNS:
systemctl status coredns
CoreDNS neu starten:
systemctl restart coredns
CoreDNS neu laden:
systemctl reload coredns
CoreDNS stoppen:
systemctl stop coredns
CoreDNS starten:
systemctl start coredns
CoreDNS-Logs anzeigen:
journalctl -u coredns -f
DNS-Konfiguration
Die primäre CoreDNS-Konfiguration ist:
/etc/coredns/Corefile
Die Standardkonfiguration leitet DNS-Anfragen weiter an:
1.1.1.1 8.8.8.8
Konfigurieren Sie das Corefile nach Ihren konkreten Anforderungen und Ihrem Anwendungsfall.
Starten Sie CoreDNS nach Änderungen am Corefile neu:
systemctl restart coredns
DNS-Endpunkte
- DNS:
53/tcpund53/udp - Health:
http://127.0.0.1:8080/health - Ready:
http://127.0.0.1:8181/ready - Metriken:
http://127.0.0.1:9153/metrics
Wichtige Dateien und Verzeichnisse
- Binärdatei:
/usr/bin/coredns - Corefile:
/etc/coredns/Corefile - Dienst:
/etc/systemd/system/coredns.service - Sysusers:
/usr/lib/sysusers.d/coredns.conf - Tmpfiles:
/usr/lib/tmpfiles.d/coredns.conf - Logrotate:
/etc/logrotate.d/coredns - Datenverzeichnis:
/var/lib/coredns - Protokolldatei:
/var/log/coredns.log - Fehlerprotokoll:
/var/log/coredns.err.log - Resolver-Override:
/etc/systemd/resolved.conf.d/99-coredns.conf
DNS-Auflösung testen
CoreDNS direkt abfragen:
dig @127.0.0.1 example.com
Oder fragen Sie ihn über die IP des Servers ab:
dig @<SERVER-IP> example.com
The host's /etc/resolv.conf is configured to use:
nameserver 127.0.0.1
Hinweise
- CoreDNS uses
systemd-resolvedKonfigurationsänderungen, um Port 53 freizugeben. - The host resolver is pointed to
127.0.0.1. - DNS-Anfragen werden an die konfigurierten Upstream-Resolver weitergeleitet.
- CoreDNS runs under the dedicated
corednssystem user.