diff --git a/docker-compose.yml b/docker-compose.yml index 4859f7b..a1f46dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,51 +2,53 @@ volumes: bind9_cache: driver: local + primary_var_lib_bind: + driver: local + secondary_var_lib_bind: + driver: local networks: - pub_dns: - name: pub_dns - driver: macvlan - driver_opts: - parent: eth0.153 - ipam: - config: - - subnet: 10.99.153.240/28 - ip_range: 10.99.153.240/28 - gateway: 10.99.153.254 + pub_dns_net: + external: true services: primary: container_name: ns1 image: ubuntu/bind9:9.18-22.04_beta restart: always + user: root environment: - TZ='America/Indianapolis' - BIND9_USER=bind volumes: - - ./primary/etc/bind/named.conf:/etc/bind/named.conf:ro - - ./primary/var/lib/bind:/var/lib/bind + #- primary_var_lib_bind:/var/lib/bind + - ./primary/var/lib/bind:/var/lib/bind:rw + - ./primary/etc/bind/named.conf:/etc/bind/named.conf + #- primary/var/lib/bind:/tmp/bind networks: - infra_dev_net: + pub_dns_net: ipv4_address: 10.99.153.241 + # command: [ "cp", "-rv", "/tmp/bind/*", "/var/lib/bind/" ] deploy: placement: constraints: [node.role == manager] - -services: secondary: container_name: ns2 image: ubuntu/bind9:9.18-22.04_beta restart: always + user: root environment: - TZ='America/Indianapolis' - BIND9_USER=bind volumes: + #- secondary_var_lib_bind:/var/lib/bind + - ./secondary/var/lib/bind:/var/lib/bind:rw - ./secondary/etc/bind/named.conf:/etc/bind/named.conf:ro - - ./secondary/var/lib/bind:/var/lib/bind + #- secondary/var/lib/bind:/tmp/bind networks: - infra_dev_net: + pub_dns_net: ipv4_address: 10.99.153.242 + #command: [ "cp", "-rv", "/tmp/bind/*", "/var/lib/bind/" ] deploy: placement: constraints: [node.role == worker] diff --git a/primary/etc/bind/named.conf b/primary/etc/bind/named.conf old mode 100644 new mode 100755 index 6bfeb61..28a4818 --- a/primary/etc/bind/named.conf +++ b/primary/etc/bind/named.conf @@ -1,96 +1,36 @@ options { - directory "/var/lib/named"; + directory "/var/lib/bind"; dump-file "/var/log/named_dump.db"; statistics-file "/var/log/named.stats"; - - # The forwarders record contains a list of servers to which queries - # should be forwarded. Up to three servers may be listed. - - #forwarders { 62.31.176.39 ; 193.38.113.3; }; - - # Enable the next entry to prefer usage of the name server declared in - # the forwarders section. - - #forward first; - - #listen-on-v6 { any; }; - - # If notify is set to yes (default), notify messages are sent to other - # name servers when the zone data is changed. Instead of setting - # a global 'notify' statement in the 'options' section, a separate - # 'notify' can be added to each zone definition. - notify yes; }; -# The following zone definitions don't need any modification. The first one -# is the definition of the root name servers. The second one defines -# localhost while the third defines the reverse lookup for localhost. - -#zone "." in { -# type hint; -# file "root.hint"; -#}; - -#zone "localhost" in { -# type master; -# file "localhost.zone"; -#}; - -#zone "0.0.127.in-addr.arpa" in { -# type master; -# file "127.0.0.zone"; -#}; - -# This is where you put in the link to the zone you -# want to serve - -zone "in.thelinuxpro.net" in { +zone "thelinuxpro.net" in { type master; - file "/var/lib/named/in.thelinuxpro.net.zone"; + file "/var/lib/bind/db.thelinuxpro.net"; allow-transfer { 10.99.153.242; }; also-notify { 10.99.153.242; }; }; -zone "254.200.10.in-addr.arpa" in { +zone "in.thelinuxpro.net" in { type master; - file "10.200.254.zone"; + file "/var/lib/bind/db.in.thelinuxpro.net"; + allow-transfer { 10.99.153.242; }; + also-notify { 10.99.153.242; }; }; -zone "99.200.10.in-addr.arpa" in { +zone "200.10.in-addr.arpa" in { type master; - file "10.200.99.zone"; + file "db.10.200"; }; -zone "53.200.10.in-addr.arpa" in { +zone "99.10.in-addr.arpa" in { type master; - file "10.200.53.zone"; -}; - -zone "153.99.10.in-addr.arpa" in { - type master; - file "10.99.153.zone"; -}; - -zone "23.99.10.in-addr.arpa" in { - type master; - file "10.99.23.zone"; -}; - -zone "22.99.10.in-addr.arpa" in { - type master; - file "10.99.22.zone"; + file "db.10.99"; }; zone "0.0.127.in-addr.arpa" in { type master; - file "127.0.0.zone"; + file "db.127"; }; - -# Include the meta include file generated by createNamedConfInclude. This -# includes all files as configured in NAMED_CONF_INCLUDE_FILES from -# /etc/sysconfig/named - -include "/etc/named.conf.include"; - diff --git a/primary/var/lib/bind/127.0.0.zone b/primary/var/lib/bind/127.0.0.zone deleted file mode 100644 index dbb2bc3..0000000 --- a/primary/var/lib/bind/127.0.0.zone +++ /dev/null @@ -1,15 +0,0 @@ - -$ORIGIN 1.0.10.in-addr.arpa -$TTL 86400 -@ IN SOA dns1.domain.com. hostmaster.domain.com. ( - 20240413021 ; serial - 21600 ; refresh after 6 hours - 3600 ; retry after 1 hour - 604800 ; expire after 1 week - 86400 ) ; minimum TTL of 1 day - - IN NS dns1.domain.com. - IN NS dns2.domain.com. - -1 IN PTR localhost. - diff --git a/primary/var/lib/bind/in.thelinuxpro.net.zone b/primary/var/lib/bind/in.thelinuxpro.net.zone deleted file mode 100644 index d294010..0000000 --- a/primary/var/lib/bind/in.thelinuxpro.net.zone +++ /dev/null @@ -1,34 +0,0 @@ -$TTL 1H -@ IN SOA in.thelinuxpro.net. root.in.thelinuxpro.net. ( - 2024041301 ; serial, todays date + todays serial # - 1H ; refresh, seconds - 2H ; retry, seconds - 1D ; expire, seconds - 1D ) ; minimum, seconds - NS ns1.in.thelinuxpro.net. - NS ns2.in.thelinuxpro.net. -; MX 10 thelinuxpro.net. ; Primary Mail Exchanger - TXT "The Linux Pro Net" - -localhost A 127.0.0.1 - -unifi A 10.200.254.254 - -;ns1 A 204.8.15.80 -;ns2 A 204.8.15.81 - -ns1 A 10.99.153.241 -ns2 A 10.99.153.242 - -1.ntp A 10.200.53.251 -2.ntp A 10.200.53.252 - -dns01 A 10.200.53.241 -dns02 A 10.200.53.242 -dns03 A 10.200.53.243 - -git A 10.99.23.12 -jenkins A 10.99.23.11 - -pi401 A 10.99.22.61 -pi501 A 10.99.22.51