I want to set up a local DNS server on my home network (like Pi-Hole or AdGuard) but add my own entries such that typing just
home directs to my home assistant instance,
plex directs to my plex instance, etc.
The problem I am foreseeing is that DNS can only resolve a name to an IP address, not IP:Port combo; and a bunch of my services run from the same machine (same IP). So when I type
home it will go to
192.168.1.100 which is the right IP but I need to give nginx the right context to know which port to reverse-proxy to. Right now nginx is configured to redirect
home.mydomain.com to the right port (and likewise for
How do I configure the nginx reverse proxy to match on single word domains? Do i have to add an entirely different entry or can I do something to match on (
home) in my nginx config?
Alternatively, do DNS have to resolve to an IP address? Or can i somehow configure pi-hole/AdGuard to resolve
home.mydomain.com, which is then hairpinned back to my own network and routed by the reverse proxy?
I asked this question on (reddit)https://www.reddit.com/r/homelab/comments/jf0ant/local_dns_server_with_nginx_reverse_proxy_how_to/) and was told to use Caddy and SRV Records, but I am extremely confused how that helps me resolve single word DNS calls like
home to the right IP + port.
This is (possibly) complicated by the fact that I want to do this for many words that resolve to the same IP but different ports. i.e.,
plex should be