Here’s some short notes on how to configure DNS for libvirt managed VMs.

  • Create a libvirt network, and add the following to it’s XML:
  <domain name='my.domain.local'/>
  • Ensure the instance has DHCP_HOSTNAME set in network-scripts. I use virt-edit to do this:
virt-edit \
    -d $name \
    /etc/sysconfig/network-scripts/ifcfg-eth0 \
    -e 's/^DHCP_HOSTNAME=.*/DHCP_HOSTNAME="'$name'"/'

(above is taken from

  • Ensure the gateway is available as a nameserver in /etc/resolv.conf:

That’s it, VMs should be pingable/contactable via their hostnames from the host.