Bug 1377680

Summary: When using dns=dnsmasq, resolving addresses on an OpenVPN link only works with the first connection.
Product: [Fedora] Fedora Reporter: Alvin <alvin>
Component: NetworkManager-openvpnAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: bgalvani, choeger, dcbw, huzaifas, lkundrak, psimerda, steve, thaller
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-20 13:41:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alvin 2016-09-20 11:19:12 UTC
When NetworkManager controls dnsmasq, 127.0.0.1 is used as DNS server. OpenVPN is then able to both use the local and remote DNS servers.

/etc/NetworkManager/NetworkManager.conf
  [main]
  dns=dnsmasq

This works, but only during the first connection.
Reproduce this by having at least one OpenVPN connection configured.

Steps to Reproduce:
1. Make sure NetworkManager controls dnsmasq (dns=dnsmasq)
2. Connect to an OpenVPN server
3. resolve DNS for a host on the network
   host hostname.example.com
   hostname.example.com has address xxx.xxx.xxx.xxx
4. Disconnect the VPN
5. Connect again to any OpenVPN server
5. resolve DNS for a host on that network

Actual results:

   host hostname.example.com
   Host hostname.example.com not found: 5(REFUSED)

Expected results:

  hostname.example.com has address xxx.xxx.xxx.xxx
  (just like the first time)

Comment 1 Beniamino Galvani 2016-09-20 13:41:07 UTC
(In reply to Alvin from comment #0)
> When NetworkManager controls dnsmasq, 127.0.0.1 is used as DNS server.
> OpenVPN is then able to both use the local and remote DNS servers.
> 
> /etc/NetworkManager/NetworkManager.conf
>   [main]
>   dns=dnsmasq
> 
> This works, but only during the first connection.

This is a known issue in dnsmasq, already tracked in bug 1373485. In the meanwhile you can use this workaround:

https://bugzilla.redhat.com/show_bug.cgi?id=1338731#c23

*** This bug has been marked as a duplicate of bug 1373485 ***