Docker container DNS resolution issue in air-gapped network can be resolved with Bobcares by your side.
At Bobcares, we offer solutions for every query, big and small, as a part of our VPN Provider Support.
Let’s take a look at how our Support Team is ready to help customers with Docker container DNS resolution issue.
How to resolve Docker container DNS resolution issue in air-gapped network
In a situation where Docker containers run on a host system in an air-gapped network, where the router is configured with a list of local DNS servers. Although the host does not have any manual DNS entries, it is still able to put forth DNS queries through the LAN’s upstream DNS servers.
Furthermore, the containers resolve from the LAN’s upstream servers. Unfortunately, sometimes a Docker container DNS resolution issue arises.
According to our Support Techs, the solution to this particular issue is to enable the host system to listen on the docker interface aside from the local loopback interface. In other words, it involves forwarding every DNS query from the docker containers to the host’s 127.0.0.53.
As systemd-resolved is not able to listen on docker0 interface, our Support Techs suggest using dnsmasq to bind to docker interface. In this scenario, dnsmasq accepts queries from the containers and relays them to the systemd-resolvd. We can install dnsmasq with the following command:
$ sudo apt-get install dnsmasq
Next, we will configure the docker daemon to point every container DNS query to forward to the Docker host system as seen below:
/etc/docker/daemon.json
After that, we have to restart docker & dnsmasq services:
$ sudo service docker restart $ sudo service dnsmasq restart
This will enable us to get LAN’s latest upstream DNS servers inside docker containers as the host’s DHCP connection changes. Furthermore, this will reflect in the containers without having to restart.
[Looking for a solution to another query? We are just a click away.]
Conclusion
In brief, our skilled Support Engineers at Bobcares demonstrated how to deal with Docker container DNS resolution issue.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments