cytopia / docker-bind

Bind (bind9) caching DNS server on Alpine or Debian with wild-card domain support [multi-arch]
http://devilbox.org/
MIT License
91 stars 50 forks source link

More flexible CNAME/IP support for WILDCARD_DNS and EXTRA_HOSTS #20

Closed EvgeniGordeev closed 2 years ago

EvgeniGordeev commented 4 years ago

Today a CNAME/IP specified for EXTRA_HOSTS/WILDCARD_DNS is assumed to be resolved to a single IP using dig @8.8.8.8 +short "${my_add}" A.

Imagine use cases:

The IP set behind load balancer is dynamic and might change a couple times a day thus it doesn't make sense to create a zone with IPs which can become stale at any time.

Suggestion: For CNAME specified WILDCARD_DNS and EXTRA_HOSTS and resolved not to a single IP create a CNAME zone instead:

$TTL  3600
@      IN SOA  example.com. root.example.com. (
 ...
;
      IN NS     example1.com.
*     IN CNAME  example1.com.
cytopia commented 2 years ago

@EvgeniGordeev thanks for the issue. I have made a major rewrite which addresses the fix in another PR: https://github.com/cytopia/docker-bind/pull/36