09 Oct 2015
Want to use domain names to access your virtual machines instead of memorizing IP addresses?
Try adding the line nameserve 192.168.122.1
to your /etc/resolv.conf
file before your other name servers.
Of course, this assumes that 192.168.122.1
is the IP address of your host machine on your virtual network.
Also, this assumes that you’re using libvirt and dnsmasq which is the default if you’re using Fedora or Red Hat/CentOS.
Now you can access your virtual machines by hostname!
Well, kind of.
You have to add a .
to the end of your hostname when you’re using it.
So, if for example, your hostname was web-devel
, you’d have to connect to web-devel.
.
Weird, but that period at the end actually makes it a fully qualified domain name.
This a DNS thing and is more complicated than I want to get into here, but it does work as a quick hack!
This blog started when I realized that there are a lot of things that are really interesting. Things that I would either like to keep for reference or share with others. Primarily, this blog was started in hopes of focusing on firmware design in FPGAs. However, it also includes posts related to my work in system administration.