---
apiVersion: v1
kind: ConfigMap
metadata:
  name: bind
data:
  named.conf: |
    options {
    	directory "/var/cache/bind";
    	dnssec-validation auto;
    	auth-nxdomain no;    # conform to RFC1035
    	listen-on { any; };
    };

    zone "http01.example.com" {
      type master;
      file "/etc/bind/db.http01.example.com";
    };

    zone "dns01.example.com" {
      type master;
      file "/etc/bind/db.dns01.example.com";
      allow-update { any; };
    };

  db.http01.example.com: |
    ;
    ; Zone used for cert-manager HTTP01 tests
    ;
    $TTL 30
    @	IN	SOA	localhost. root.localhost. (
    			      1		; Serial
    			 604800		; Refresh
    			  86400		; Retry
    			2419200		; Expire
    			 604800 )	; Negative Cache TTL
    @	IN	NS	localhost.
    *.ingress-nginx	IN  A {SERVICE_IP_PREFIX}.15
    ingress-nginx	IN	A	{SERVICE_IP_PREFIX}.15

  db.dns01.example.com: |
    ;
    ; Zone used for cert-manager DNS01 tests
    ;
    $TTL 30
    @	IN	SOA	localhost. root.localhost. (
    			      1		; Serial
    			 604800		; Refresh
    			  86400		; Retry
    			2419200		; Expire
    			 604800 )	; Negative Cache TTL
    @	IN	NS	localhost.
    dummy	IN	A	{SERVICE_IP_PREFIX}.15
