if (ipdef->nranges || ipdef->nhosts)
virCommandAddArg(cmd, "--dhcp-no-override");
+ /* add domain to any non-qualified hostnames in /etc/hosts or addn-hosts */
+ if (network->def->domain)
+ virCommandAddArg(cmd, "--expand-hosts");
+
if ((dctx = networkSaveDnsmasqHostsfile(ipdef, network->def->dns, network->def->name, false))) {
if (dctx->hostsfile->nhosts)
virCommandAddArgPair(cmd, "--dhcp-hostsfile",
-/usr/sbin/dnsmasq --strict-order --bind-interfaces --conf-file= \
---except-interface lo --listen-address 192.168.122.1 \
---addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
+/usr/sbin/dnsmasq --strict-order --bind-interfaces --domain example.com \
+--conf-file= --except-interface lo --listen-address 192.168.122.1 \
+--expand-hosts --addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
<uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
<forward dev='eth0' mode='nat'/>
<bridge name='virbr0' stp='on' delay='0' />
+ <domain name="example.com"/>
<dns>
<host ip='192.168.122.1'>
<hostname>host</hostname>
--conf-file= --except-interface lo --listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
---dhcp-lease-max=253 --dhcp-no-override --enable-tftp \
+--dhcp-lease-max=253 --dhcp-no-override --expand-hosts --enable-tftp \
--tftp-root /var/lib/tftproot --dhcp-boot pxeboot.img\
--conf-file= --except-interface lo --listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
---dhcp-lease-max=253 --dhcp-no-override --dhcp-boot pxeboot.img,,10.20.30.40\
+--dhcp-lease-max=253 --dhcp-no-override --expand-hosts \
+--dhcp-boot pxeboot.img,,10.20.30.40\