To understand it, please read the article Understanding DNS behavior with Bind9 and dnsmasq.
Run the following command to start servers A and B:
docker compose up -d dns-a dns-b
Run the server:
docker compose up dns-initial
In another terminal, you can query the dns-initial
with the following commands:
dig -t A @127.0.0.1 -p 30010 willianantunes.com
dig -t A @127.0.0.1 -p 30010 db-a.privatelink.database.windows.net
dig -t A @127.0.0.1 -p 30010 db-b.privatelink.database.windows.net
Run the server:
docker compose up dns-initial-dnsmasq
In another terminal, you can query the dns-initial-dnsmasq
with the following commands:
dig -t A @127.0.0.1 -p 30005 willianantunes.com
dig -t A @127.0.0.1 -p 30005 db-a.privatelink.database.windows.net
dig -t A @127.0.0.1 -p 30005 db-b.privatelink.database.windows.net
Sometimes the query will return NXDOMAIN
either for db-a
or db-b
. This happens because the DNS Proxy returns the first answer it receives. Learned it from a reddit post.