Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
network: disable DNS server when not needed
Libvirt automatically starts a DNS server for a virtual network, even if there is no forwarding or local domains configured. This by itself is perhaps wasteful, but not an issue. The issue arises in tests using multiple networks per VM. Some distributions (for example: CentOS 7) configure DNS resolution without any coordination, leading to a situation where /etc/resolv.conf points to the DNS server on the secondary network. Tests may want stop/start these secondary interfaces at will, leading to situations where DNS queries can't be resolved because the DNS server is temporarily not reachable. The solution implemented here explicitly disables the DNS server when both no forward mode and no local domain was specified. For tests this means that the DNS server is basically always the one on the access network (which presumably has a forward mode configured).
- Loading branch information