4
2
My Hyper-V host is Windows 10 Enterprise x64. I only have one guest running: archlinux.
The guest is connected to all NICs:
- WiFi
- Ethernet (physical)
Occasionally, I will SSH into the guest from either the host system or any other PC on my local network. No PC in my local network has a static IP, including the guest system.
The problem is that after booting the host (and thus booting the guest), the guest's IP is dynamically set and unknown. Only after connecting to the guest and performing ip addr
, I can use the IP address for SSH connections (root@192.168.0.*
).
I want to access the guest system by the hostname so that I don't have to retrieve the IP every time. Here is the problem:
Let's say the archlinux guest was assigned the IP 192.168.0.24
. The arch hostname is configured as Hyper-al
. I can ping every (Windows) PC in my network by their hostname (e.g. ping DESKTOP-XXXXX
) and their IP. Pinging the guest using it's IP works just fine. However, the hostname Hyper-al
does not resolve.
So when I for example try to connect to the guest using PuTTY, I can do so just fine with the IP. When I however try with the hostname, it does not resolve. The hostname is properly configured within arch in both /etc/hostname
and /etc/hosts
and recognized by e.g. PuTTY after logging in using the IP.
How can I access the arch guest by it's hostname? I've had success doing this with ubuntu server guests, so I imagine it would have to work.
The connecting 'from' machine (the PuTTy machine) needs to have a IP > Hostname binding as well. – linuxdev2013 – 2016-09-29T11:51:05.133