DNS In Containers?

So I am using subdomains to access my containers. It seems to be working.
However, on the webpage inside the container, I have an Iframe. I set the “src” of
the iframe to LPC1.lxd:3000/Embed/0xXXXXXXXXXXXXXXXXXXXXXX

Fidler is giving me this:

[Fiddler] The connection to ‘lpc1.lxd’ failed.
Error: TimedOut (0x274c).
System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

And within the container I ping it:
root@LPC1:/var/www/html# ping LPC1.lxd
PING LPC1.lxd ( 56(84) bytes of data.

As you can see, the IP’s are obviously different between the Fiddler output and the pin output?
Any ideas why?




What do you mean by I am using subdomains to access my containers?
Is that DNS subdomains or something else? How did you create them?

One IP is a public IPv4 address, the other is a private IP address for LXD. There must be some translation taking place, which will make sense if you can describe how you setup the network.
In any case, if lpc1.lxd:3000 is not responding, you would need to connect with, for example, nc.

Thanks for responding Simos….

I have created subdomains (A records) such as lpc1.mydomain.us

I then have HAproxy at mydomain.us that forwards to a container with host name lpc1, lpc2, etc. Make sense?

The issue is the webpage at lpc1 has an iframe in the html with the src of the iframe being http://lcp1.lxd:3000/Embed/0xxxxxxxxxx

that will not connect when I browse to it.

When I don’t use containers, this works fine as: <iframe src= http://”VPS IP”:3000/Embed/0xxxxxxxx

When I browse to http://lpc1.mydomain.us I get different results, such as connection refused or a blank page,

so I seem to be having multiple issues.

The actual results of browsing should be the activation of a video player from the iframe src.

At this point I am not sure whether it’s a container config issue or not, but I’m leaning to it being some sort of routing issue?


That service (Fiddler?), where is it located? On the host or in the LPC1 container?
Because if it is in the container listening to port 3000, you would need to expose that port using HAProxy, so that it is accessible from the Internet.
You would need a new entry in HAproxy for port 3000, either for a TCP port or a HTTP port.

Fiddler is on the host.

Then, from the point of view of the container, the Fiddler service is on IP address