Docker Container - Network Bridge, No Container Resolution on 127.0.0.11


Recommended Posts

I think the title pretty much says it all really.

 

I can ping 127.0.0.11 however if I dig like

 

dig @127.0.0.11 mariadb

 

I get nothing back, it just times out trying to connect to the DNS server.

 

I should mention that all external DNS resolution works and is passed though to my router (when not trying to resolve a local container name directly).

 

This seems like a basic part of Docker, but I am unsure where to look next.

 

At this stage, I am not even sure how the image is being given my hosts DNS, the resolve.conf is empty.

 

Hoping someone can point me in the right direction.

Link to comment

Ken-jl, are you saying the docker resolver 127.0.0.11 only works with containers not in bridge mode?

 

I have a proftpd container, configured for mysql authenication.

 

I have a mariadb container, called mariadb.

 

From the proftpd container, I was expecting to be able to dig @127.0.0.11 for mariadb, and get a response back like 172.15.0.3 for example.

 

Is this not how it should work?

Link to comment

Hmm that's seems to be the correct behavior.

Is your proftpd container network-linked to the mariadb?

ie did you create a custom docker network and then connect the proftpd and mariadb to that?

on the default bog standard bridge network its not going to work

otherwise it should work like this.

root@MediaStore:~# docker network create bridge2
89bbdd77e82561fb7223055c3f6c1bdf6092e66241c10f4c0172cb2b6cc9bcec
root@MediaStore:~# docker run -d --network bridge2 --name box1 --rm alpine:latest sleep 3600
6fb56d0ef4ab42060930b1a01108467f5e26b61e52d212d16ff7e6158a1afee0
root@MediaStore:~# docker run -d --network bridge2 --name box2 --rm alpine:latest sleep 3600
28f4f19fd5e1c48832340b5639dd8abbd979f1909a5877cc367590fc54eae1be
root@MediaStore:~# docker exec box1 nslookup box2
Server:         127.0.0.11
Address:        127.0.0.11:53

Non-authoritative answer:
*** Can't find box2: No answer

Non-authoritative answer:
Name:   box2
Address: 172.19.0.3

root@MediaStore:~# docker exec box2 nslookup box1
Server:         127.0.0.11
Address:        127.0.0.11:53

Non-authoritative answer:
*** Can't find box1: No answer

Non-authoritative answer:
Name:   box1
Address: 172.19.0.2

How this maps in the GUI is beyond me.

Link to comment

Hmm this is interesting, thanks for the example.

 

the reason i don't normally create a custom network, is that I still want it accessible from the main hosts IP (so the mariadb accessible by other machines on the network)

 

I guess my next next is to test it in this configuration.

Thank you!

I will feedback / mark solved once tested (maybe a couple days)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.