The
BOSH DNS job running in each Diego Cell respects aliases configuration in the following folders:
$ cat /var/vcap/jobs/bosh-dns/config/config.json | json_pp | grep alias_files_glob
"alias_files_glob" : "/var/vcap/jobs/*/dns/aliases.json",
For more information on the syntax of
aliases.json, refer to the following documentation:
https://bosh.io/docs/dns/#exampleFor example:
## resolving external services
{ "svc1.xxx.com":["10.193.78.10"],
"svc2.xxx.com":["10.193.78.20"]
}
## bypassing LB
{ "app.CF_APP-DOMAIN":["<Gorouter IP>"]
}
Option-A: Include your customer DNS records into each Diego Cell
- Create the file aliases.json which contains the DNS records you need. Copy it to each Diego Cell using bosh scp.
bosh -d cf-xxx scp ./aliases.json diego-cell:/tmp/aliases.json
- Make your aliases effective in each Diego Cell.
bosh -d cf-xxx ssh diego_cell -c 'sudo mkdir -p /var/vcap/jobs/my-aliases/dns/; sudo cp /tmp/aliases.json /var/vcap/jobs/my-aliases/dns/; sudo /var/vcap/bosh/bin/monit restart bosh-dns'
- Remove the aliases after you complete the testing.
bosh -d cf-xxx ssh diego_cell -c 'cd /var/vcap/jobs/; sudo rm -r my-aliases/; sudo /var/vcap/bosh/bin/monit restart bosh-dns'
Option-B: Include your customer DNS records into specific Diego Cells
- For the application which requires these DNS records, identify the Diego Cells which host application containers.
cf curl /v2/apps/$(cf app --guid APP-NAME)/stats | grep host
- Use similar steps as in Option-A but specify the Diego Cell instance name. For example:
bosh -d cf-xxx scp ./aliases.json diego-cell/209c42e5-3c1a-432a-8445-ab8d7c9f69b0:/tmp/aliases.json
bosh -d cf-xxx ssh diego_cell/209c42e5-3c1a-432a-8445-ab8d7c9f69b0 <...>
Warning: Please note that changing BOSH DNS entries on a Cell will apply those changes to
all applications running on the Cell, not just a single application.