Closed mihai-vlc closed 2 years ago
Thanks for the post. I haven't worked much with hyper-v but, if it runs a DNS server on its virtual network then you can just create a conditional forwarder zone in your Technitium DNS server setup for "dev.mshome.net" and point it to the IP address of that hyper-v DNS server. You can then add a CNAME record in any of you zones that point to "dev.mshome.net" and it would work.
You will need to find out the IP address for the hyper-v DNS server though by checking what DNS server is being configured by the virtual network on your VMs. Try to query those DNS servers using nslookup command to see if they are responding as expected.
Another option is to not use the default virtual switch DHCP and simply run your own DHCP server on the network to assign IP address which then gets updated in the DNS server if you use the built-in DHCP server.
I had a second look at this today.
After reading your comment I decided to stop fighting against that hyper v default virtual switch since I don't fully understand how it works.
The VMs were created with multipass and I later learned that I need to preserve that default switch adapter so multipass can continue to communicate with the VMs.
Finally I ended up with this setup (posting it here in case it might help someone in the future):
/etc/netplan/
and created a new yaml file with this content
network:
ethernets:
eth1:
dhcp4: true
version: 2
I took that eth1
value from the output of ip a
I then used the DHCP server from the router to give these VMs static IPs based on the MAC address.
Thank you for taking the time to reply !
I am using hyper v on windows 10 to manage some VMs. The VMs are connected to the default virtual switch (connection type: internal network) which creates a hosts.ics file which looks something like this:
The IP of the
dev.mshome.net
changes each time the VM is rebooted.The end result that I would like to have is:
myapp.internal
->dev.mshome.net
which will then read the hosts.ics file and go to the correct VM.Is there a way to setup a CNAME record in the DNS server that somehow takes into account that hosts file ?
I am new to all these DNS concepts so I may be looking at this from the wrong perspective. I just don't know how else I could tackle this.