Skip to content

Resolving VM names when using socket_vmnet network #2358

Closed Answered by Ranjandas
Ranjandas asked this question in Q&A
Discussion options

You must be logged in to vote

If anyone else has this requirement, I managed to get it working using mDNS. Initially, I tried with Avahi, but then later realized that systemd-resolved has a built-in option to use mDNS.

All I had to do is:

  • Create the resolved config
# file: /etc/systemd/resolved.conf.d/mdns.conf
[Resolve]
MulticastDNS=yes
  • Restart systemd-resolved
sudo systemctl restart systemd-resolved

Once this is done, other VMs using socket_vmnet can be addressed by using <vm-name>.local.

[ranjan@lima-murphy-srv-01 ~]$ systemd-resolve lima-murphy-cli-01.local
lima-murphy-cli-01.local: 192.168.105.10       -- link: lima0

-- Information acquired via protocol mDNS/IPv4 in 2.6ms.
-- Data is authenticated: no; Dat…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nirs
Comment options

Answer selected by Ranjandas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants