From 1fbf3a9407f267365d3f66f1134e417ce3a5c607 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 15 Oct 2023 20:44:12 +0200 Subject: [PATCH] create config powerdns --- ansible/group_vars/DNS | 19 +++++++++++++++++++ ansible/playbooks/dns.yml | 6 ++++++ ansible/production | 2 ++ ansible/roles/requirements.yml | 2 ++ ansible/staging | 3 +++ docs/ADR/004-DNS.md | 31 +++++++++++++++++++++++++++++++ 6 files changed, 63 insertions(+) create mode 100644 ansible/group_vars/DNS create mode 100644 ansible/playbooks/dns.yml create mode 100644 docs/ADR/004-DNS.md diff --git a/ansible/group_vars/DNS b/ansible/group_vars/DNS new file mode 100644 index 0000000..211b98b --- /dev/null +++ b/ansible/group_vars/DNS @@ -0,0 +1,19 @@ +pdns_config: + local-address: "127.0.0.1" + local-port: "5300" + api: yes + api-key: + +pdns_backends: + gsqlite3: + dnssec: yes + database: "/var/lib/powerdns/powerdns.sqlite" +pdns_sqlite_databases_locations: + - "/var/lib/powerdns/powerdns.sqlite" + +pdns_rec_config: + forward-zones: + - "consul=127.0.0.1:8600" + - "ducamps.win=192.168.1.10" + - "ducamps.eu=192.168.1.10" + local-address: "{{ ansible_default_ipv4.address }}" diff --git a/ansible/playbooks/dns.yml b/ansible/playbooks/dns.yml new file mode 100644 index 0000000..4a1415a --- /dev/null +++ b/ansible/playbooks/dns.yml @@ -0,0 +1,6 @@ +--- +- name: DNS playbook + hosts: DNS + roles: + - role: pdns_recursor-ansible + become: true diff --git a/ansible/production b/ansible/production index 6133921..a08828c 100644 --- a/ansible/production +++ b/ansible/production @@ -7,6 +7,8 @@ gerard corwin merlin +[DNS] +gerard [dhcp] gerard diff --git a/ansible/roles/requirements.yml b/ansible/roles/requirements.yml index 0766b6b..04e4379 100644 --- a/ansible/roles/requirements.yml +++ b/ansible/roles/requirements.yml @@ -39,3 +39,5 @@ scm: git - src: git@github.com:vincentDcmps/ansible-role-nfs.git scm: git +- src: https://github.com/PowerDNS/pdns-ansible.git +- src: https://github.com/PowerDNS/pdns_recursor-ansible.git diff --git a/ansible/staging b/ansible/staging index 56fde06..faeb8d4 100644 --- a/ansible/staging +++ b/ansible/staging @@ -5,6 +5,9 @@ gerard-dev [VPS] merlin-dev +[DNS] +oscar-dev + [database] oscar-dev diff --git a/docs/ADR/004-DNS.md b/docs/ADR/004-DNS.md new file mode 100644 index 0000000..db3793c --- /dev/null +++ b/docs/ADR/004-DNS.md @@ -0,0 +1,31 @@ +# 004 DNS + +## Status + +In progress + +## Context + +curently main local domain DNS is located on NAS. + +goal: + +- avoid DNS outtage in case of NAS reboot (my synology have 10 years and is a litle long to reboot) morever during NAS reboot we lost the adblock DNS in the nomad cluster because nomad depend of the NFS share. +- remove the direct redirection to service.consul DNS and the IPTABLE rule use to redirect port 53 on consul on gerard instead new DNS could be forward directly to an active consul node on port 8300 + +### DNS software + +need DHCP Dynamic update +could redirect domain on other port than port 53 + +## Decision + +we will migrate Main Domain DNS from NAS to gerard (powerDNS) +powerDNS provide two disting binaries one for authority server one other for recursor +goal is to first migrate the recursice part from synology to a physical service +and in second time migrate authority server in nmad cluster + +## Consequences + +before to move authority server need to remove DB dns dependance (create db consul services) +need to delete the iptable rule on gerard before deploy