to start - I am still looking around on site investigating answers that look like they may allow me to find solution to my problem, posting here definitely isn't my first stop to find a solution I have been trying things for a while today. Also - thank you for reading. I am working on an assignment for class where the object is to run a bind9 docker container as a DNS Load balancer to balance requests between two web servers using the round-robin method. So basically if I put in a request to the web server's domain name it will go to one web server's IP address, then the next request will go to next web server's IP address. I apologize if my terminology is a bit off, I'm still learning this stuff, but hopefully I've gotten the point across. I have been trying to use 2 Ubuntu 16.04 VMs for this, one with an httpd container running and one with httpd container and bind9 container running. I am able to get the web servers running, I'm able to connect to them using the host IP, and I'm also able to get the bind9 container running. The part I'm really having trouble with is actually getting the bind9 DNS container to take me to the web server(s) if I enter the domain name into the browser.
Here is the command I used to start the bind9 container: docker run -d --name=bind --dns=127.0.0.1 --publish=192.168.0.45:53:53/udp --publish=192.168.0.45:10000:10000 --volume=/srv/docker/bind:/data --env='ROOT_PASSWORD=SecretPassword' sameersbn/bind:latest
And the web servers are pretty straightforward I just bind the directory with my index.html file to /usr/local/apache2/htdocs and publish it to port 80 of host from port 80 of container.
All this has to be is a really simple setup on my local network so I don't need to register a domain name, I don't need mail servers or anything, ALL I NEED TO DO, is be able to use 'dig' to query the DNS server for the load balanced hostname, and have it resolve to the two different IP addresses of the web servers. Thank you for any guidance on this I would really appreciate a bit of help, I've looked at a ton of resources and I just don't know what's going wrong.
After I start the DNS server (bind9 container), I can use the command 'host google.com 172.x.x.x' and it returns the right info, 172.x.x.x is the IP of the docker container I guess, because my local network is 192.168.0.1/24. When I try to do the same command with the IP of the docker host, it says REFUSED. I tried editing ACL's, using webmin to add zones and address records, and I just couldn't get it working. I'll stop writing now hopefully I've given enough info, thank you for reading.