I'm using dnsmasq as DHCP server in VM environment. But It didn't working. I disabled basic DHCP feature in libvirt.

  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:7B:64:0B'/>
  <ip address='' netmask=''>

As you can see, I removed this tag!

  <range start='' end='' />

And I installed dnsmasq in Host machine. During installation dnsmasq, there was an error message about failed to create listening socket for So I commented out listen-address option, and added dhcp-range/dhcp-option options, like this.


That's all I've done with dnsmasq. But guest VM couldn't get IP address from host which is dnsmasq server running.

After that , I installed isc-dhcp-server instead of dnsmasq.... and it works! But I still want to use dnsmasq instead of isc-dhcp-server. Are there any helping hands?

  • I disabled host machine's firewall.
  • I've heard that libvirt basically use dnsmasq. Is this the reason why I couldn't use dnsmasq in libvirt environment?
  • Your config snippet does not show listen-address commented out - have you really done this ? Is dnsmasq actually running ?
    – user9517
    May 21, 2014 at 6:38
  • I've tried to use 'listen-address=' and remove it, the results are the same. It didn't work.
    – gunsmoke
    May 21, 2014 at 7:04
  • I found this link. I'm using Ubuntu 12.04, and maybe the version of dnsmasq(2.59) can make problem. I don't know exactly, but I'll try to use newer version later.
    – gunsmoke
    May 21, 2014 at 7:57
  • Why are you doing this? libvirt handles dnsmasq for you, so you should allow it to do so. May 21, 2014 at 13:27
  • You're right. But I want to show how DHCP and DNS server work using VM environments.
    – gunsmoke
    May 21, 2014 at 14:44

1 Answer 1


Libvirt does indeed use DNSMasq to handle DHCP. If you're trying to do some advanced configs with DNSMasq, you need to make sure Libvirt is not interfering (removing the DHCP option from your config would work).

Your actual issue appears to be caused by the 'listen-address' statement. DNSMasq requires a valid IP address in the subnet you're trying to assign to. You should configure it to use an IP in the range. If you don't do this, it won't actually be able to assign any IP addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.