Red Hat Bugzilla – Bug 1341460
update dns settings in network by net-update will not take effect immediately
Last modified: 2016-11-03 14:46:15 EDT
Description of problem: update dns settings in network will not take effect immediately. Version-Release number of selected component (if applicable): libvirt-1.3.4-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: # virsh net-dumpxml network <network> <name>network</name> <uuid>2531df5b-adf0-471f-95f7-68d627053342</uuid> <bridge name='virbr2' stp='on' delay='0'/> <mac address='52:54:00:90:a1:29'/> <domain name='example.com'/> <dns> <txt name='example' value='example value'/> <srv service='name' protocol='tcp' domain='test-domain-name' target='englab.nay.redhat.com' port='1024' priority='10' weight='10'/> <host ip='192.168.10.2'> <hostname>myhost</hostname> <hostname>myhostalias</hostname> </host> </dns> <ip address='192.168.10.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.10.2' end='192.168.10.254'/> </dhcp> </ip> </network> # virsh net-update network delete dns-srv "<srv service='name' protocol='tcp'/>" Updated network network live state # virsh net-update network delete dns-txt "<txt name='example'/>" Updated network network live state # virsh net-dumpxml network <network> <name>network</name> <uuid>2531df5b-adf0-471f-95f7-68d627053342</uuid> <bridge name='virbr2' stp='on' delay='0'/> <mac address='52:54:00:90:a1:29'/> <domain name='example.com'/> <dns> <host ip='192.168.10.2'> <hostname>myhost</hostname> <hostname>myhostalias</hostname> </host> </dns> <ip address='192.168.10.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.10.2' end='192.168.10.254'/> </dhcp> </ip> </network> # cat /var/lib/libvirt/dnsmasq/network.conf ##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE ##OVERWRITTEN AND LOST. Changes to this configuration should be made using: ## virsh net-edit network ## or other application using the libvirt API. ## ## dnsmasq conf file created by libvirt strict-order domain=example.com expand-hosts pid-file=/var/run/libvirt/network/network.pid except-interface=lo bind-dynamic interface=virbr2 dhcp-option=3 no-resolv txt-record=example,example value srv-host=_name._tcp.test-domain-name,englab.nay.redhat.com,1024,10,10 dhcp-range=192.168.10.2,192.168.10.254 dhcp-no-override dhcp-lease-max=253 dhcp-hostsfile=/var/lib/libvirt/dnsmasq/network.hostsfile addn-hosts=/var/lib/libvirt/dnsmasq/network.addnhosts Actual results: The txt and srv still exists in the network.conf file after delete. And still can parse correctly in the guest. Expected results: dnsmasq should restart to get the change about dns. Additional info: N/A
There is already a patch from laine for this problem. https://www.redhat.com/archives/libvir-list/2016-May/msg02122.html
Upstream commit (will be in 1.3.5) commit 93b59fcff60ee3e2ac3e67164b992d1335e9d0a2 Author: Laine Stump <laine@laine.org> Date: Tue May 31 11:51:29 2016 -0400 network: restart dnsmasq after adding/removing txt and srv records
verified on libvirt-1.3.5-1.el7.x86_64, the result is as expected.Move it to verified. 1. start a network with srv txt and host defined in dns section. 2. start a guest using this network, and use dig to check all the srv, txt, host record works fine. 3. check the network's conf file and the pid of dnsmasq 4. delete the txt, srv, and host in dns section # virsh net-update network add dns-txt "<txt name='example' value='example-test'/>" Updated network network live state 5.On the guest, check #dig -t txt example ----->will get no answer. check the config file on the host, the txt record is deleted. # cat /var/lib/libvirt/dnsmasq/network.conf check the pid of dnsmasq, it is different with step 3. 6. same steps for dns-srv, dns-host 7. same with step5 to check "add dns-txt" "add dns-srv" # virsh net-update network add dns-txt "<txt name='example1' value='example-test1'/>" Updated network network live state 8. for add dns-host # cat net.xml <host ip='192.168.10.3'> <hostname>mynewhost</hostname> <hostname>mynewhostalias</hostname> </host> # virsh net-update network add dns-host --xml net.xml Updated network network live state # cat /var/lib/libvirt/dnsmasq/network.addnhosts 192.168.10.3 mynewhost mynewhostalias 9. these section can not be modified # virsh net-update network modify dns-srv "<srv service='name' protocol='tcp' domain='test' target='tessdfdf'/>" error: Failed to update network network error: Operation not supported: DNS SRV records cannot be modified, only added or deleted # virsh net-update network modify dns-txt "<txt name='example' value='example-'/>" error: Failed to update network network error: Operation not supported: DNS TXT records cannot be modified, only added or deleted 10. add same record will report error # cat /var/lib/libvirt/dnsmasq/network.addnhosts 192.168.10.3 mynewhost mynewhostalias # cat net.xml <host ip='192.168.10.3'> <hostname>myneeeewhost</hostname> <hostname>myneeeewhostalias</hostname> </host> # virsh net-update network add dns-host --xml net.xml error: Failed to update network network error: Requested operation is not valid: there is already at least one DNS HOST record with a matching field in network network
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html