ข้ามไปยังเนื้อหาหลัก
ลด 50% ทุกแพลน เวลาจำกัด เริ่มต้นที่ $2.48/mo
CoreDNS

CoreDNS

CoreDNS คือเซิร์ฟเวอร์ DNS ที่ต่อปลั๊กอินเป็นสายงาน ให้บริการโซนจากไฟล์ etcd หรือ Kubernetes ส่งต่อพร้อมแคช และเพิ่ม DNS-over-TLS หรือเมตริก Prometheus ได้ด้วยการเติมบรรทัดเดียวใน Corefile ใช้สัญญาอนุญาต Apache-2.0 และมีดาว GitHub มากกว่า 14,200 ดวง

ภาพรวม

14.3k

GitHub stars

1

การดูหน้า

สัญญาอนุญาต Apache-2.0 เวอร์ชัน Latest OS Ubuntu Server 24.04 LTS Min RAM 1 GB IP IPV4,IPV6

การจัดการบริการ

ตรวจสอบสถานะ 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
  • การแทนที่ค่า resolver: /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-resolved การเปลี่ยนการกำหนดค่าเพื่อปล่อยพอร์ต 53
  • The host resolver is pointed to 127.0.0.1.
  • คำสอบถาม DNS จะถูกส่งต่อไปยัง resolver ต้นทางที่กำหนดไว้
  • CoreDNS runs under the dedicated coredns system user.

เพิ่มเติมในเครือข่าย

แอปที่เกี่ยวข้อง

ติดตั้ง CoreDNS ได้เลยตอนนี้ เริ่มต้น $2.48/เดือน