0

I have a bunch of Debian VMs running on a Debian host, they're all connected through an internal private network. One of said VMs has static IP set to 10.0.0.1 and acts as a DHCP/DNS server running dnsmasq serving IP addresses to every machine on the network.

Inside the same internal network there is another VMs running a self-hosted GitLab. I obviously can reach it when the browser is pointing to http://hostname or http://hostname.mylocaldomain.lan, but I would love to reach it from gitlab.mylocaldomain.lan.

I don't want to set static IPs for my VMs therefore I'm not able to add a line to the router's /etc/hosts resolving the address to the VM's IP, and honestly I would rather simply have dnsmasq handle it automatically. The following line in /etc/hosts doesn't work (duh):

hostname gitlab.mylocaldomain.tld

Is there any way to instruct dnsmasq to "recursively" resolve the query (like gitlab.mylocaldomain.tld resolving to hostname, and then hostname resolving to the DHCP-leased IP)?

My last resort would be to give the VM a hostname gitlab, but I'd very much rather not because it looks awful and prone to additional complications (and configs) down the road.

nxet
  • 101
  • 1

0 Answers0