How to use bind9

When adding an environment template you can select BIND9 as DNS service.

Reading the docs, I’d guess that every service launched in this environment will get an FQDN which is registered in BIND9 for the given domain.

But this is not case. So how can I use the bind9 service?

An FQDN is generated for any service with an exposed port. Is this happening with the bind9 service?

It works this way:

  1. Add new environment template
  2. enable bind9, add TSIG Key Name (eg: “secret”) and TSIG Key (eg “+Cdjlkef9ZTSeixERZ433Q==”)
  3. enable dnsupdate-rfc2136 and again, add the same TSIG info

Start environment and you’re good to go. You can open up bind9 and DNS-UPDATE Container log and there you can see:

start an nginx-container called “nginx3” in stack “t” in environment "lab"
This will result in: nginx3.t.lab.example.tld

Your’re logs should show:

DNS-Update:
time=“2016-12-09T15:32:19Z” level=info msg=“Adding dns record: {nginx3.t.lab.example.tld. [10.0.1.14] A 60}”

bind9:
9.12.2016 … 15:32:19.357 client 10.42.246.158#47137/key secret: signer “secret” approved
9.12.2016 … 15:32:19.357 client 10.42.246.158#47137/key secret: updating zone ‘vdr/IN’: adding an RR at ‘nginx3.t.lab.example.tld’ A

Also now the
"fqdn": “nginx3.t.lab.example.tld”

is set!

This way we can now finally set up a local dev-environment in our LAN with our DNS and the Load Balancer with rancher (as reverse proxy)

Rancher is awesome!

2 Likes

I’m having trouble following your instructions.

When I enable dnsupdate-rfc2136, one of the required fields is DNS Server IP (Server IP or Hostname).

How am I to know what server ip or hostname to use?

The external-dns provider sends updates to an existing DNS server via zone transfers. It doesn’t create a DNS server itself. You have to provide one (and know where it is).