I have a VM for web development that I have moved from a hyperv instance and I want to know what the current best way to access it is.
I have created the VM via virt-manager and I can see it. Next step is accessing the web sites.
On Windows I had multiple entries in the hosts file of the type 192.168.x.xxx centos8.local, 192.168.x.xxx website1.local etc
2 questions:
Is it still ok to do something like this? From reading around, it seems mdns uses .local. Will I clash with anything?
With all the recent changes in the networking stack, is my old approach still the best way? I can add the entries manually to /etc/hosts, but with systemd-resolved is there a better way that I should learn?
For very small sized environments such as you describe, /etc/hosts should work fine. This assumes you work in a hub-and-spoke-like configuration, one system on which you use /etc/hosts in the middle, connecting to these additional systems. But for more of a mesh environment, you’ll find maintaining /etc/hosts files on multiple systems to be a nuisance and error prone. I moved from trying to manage /etc/hosts on a handful of systems to using dnsmasq to manage my local server namespace. Now I edit in one place, and through the magic of DNS, all systems know where the new server can be reached. Dnsmasq is installed on a single always-on system which is my local DNS server. Search for articles on dnsmasq for more information when management of your small domain becomes more effort than you find comfortable.