Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

CoreDNS avec Docker

Ce projet configure un serveur DNS CoreDNS utilisant Docker Compose. Il inclut une zone DNS pour example.org et des plugins pour la journalisation, la gestion des erreurs, et la surveillance de l'état du service.

Structure du projet

coredns/
├── docker-compose.yml  # Configuration Docker Compose
├── Corefile             # Configuration CoreDNS
└── zones/               # Fichiers de zone DNS
    └── example.db        # Zone DNS pour example.org

Configuration

Corefile

Le fichier Corefile configure CoreDNS avec les plugins suivants :

  • file : Pour servir la zone DNS statique example.org.
  • log : Pour journaliser les requêtes DNS.
  • errors : Pour afficher les erreurs.
  • health : Pour surveiller l'état du service sur le port 8080.
  • forward : Pour rediriger les requêtes vers Google DNS (8.8.8.8, 8.8.4.4).

Zone DNS

Le fichier zones/example.db définit la zone DNS pour example.org avec les enregistrements suivants :

  • example.org : 192.168.1.101
  • ns1.example.org : 192.168.1.101
  • www.example.org : 192.168.1.101

Déploiement

  1. Démarrer CoreDNS :

    docker-compose up -d
  2. Vérifier l'état du service :

    curl http://localhost:8080/health
  3. Tester la résolution DNS :

    dig @localhost example.org
    dig @localhost www.example.org

Exemple de sortie

; <<>> DiG 9.18.28-1~deb12u2-Debian <<>> @localhost example.org
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1730
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 9b8a5aa0d6db3c3e (echoed)
;; QUESTION SECTION:
;example.org.               IN      A

;; ANSWER SECTION:
example.org.        3600    IN      A       192.168.1.101

;; AUTHORITY SECTION:
example.org.            3600    IN      NS      ns1.example.org.

;; Query time: 3 msec
;; SERVER: ::1#53(localhost) (UDP)
;; WHEN: Tue Feb 25 21:43:34 CET 2025
;; MSG SIZE  rcvd: 127

Arrêt

Pour arrêter CoreDNS :

docker-compose down

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors