Name resolution that includes port number?

Started by Sar6e, September 09, 2022, 01:28:17 AM

Previous topic - Next topic
I'd like to not have to remember all the port numbers for the various docker containers running on a single host.  Ideally I'd be able to type "service.server.domain" and have the DNS be able to resolve that to ip:port.

For example if my wiki is exposed as port 9082 on the server fred at hb.com at 192.168.1.100, it would be great to just type wiki.fred.hb.com and have that resolve to 192.168.1.100:9082 rather than having to remember which port the wiki uses.

Is there a way to achieve this or am I dreaming?



Quote from: bartjsmit on September 09, 2022, 07:54:50 AM
You mean a SRV record? https://en.wikipedia.org/wiki/SRV_record
Thanks for the reply.  Looking at that wikipedia entry, I think so.  I found an old reddit thread which suggests srv records can be added to the "Custom Option" in Unbound DNS.  I'm not seeing that option any more in the general settings page of the Unbound DNS Service so things may have changed. 

At least though it gives me a search term to investigate further.  I find half the battle is working out what the thing you need is called.  I want to say I used to be able to create an alias in Sophos UTM...

No browser can interpret SRV records. But the approch of using HA-Proxy as a frontend is viable.

You could hide all docker containers behind one IP with several names and have HA-Proxy do the distribution to different docker backends.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+