Red Hat Bugzilla – Bug 592630
openswan irrevocably corrupts /etc/resolv.conf
Last modified: 2010-11-11 09:52:13 EST
Description of problem:
When using vpnc (or openvpn) I get /etc/resolv.conf of this kind:
johanka:matej# cat /etc/resolv.conf
# Generated by NetworkManager
i.e., aside from the RH internal DNS servers I have also as a third server the original non-VPN server. Seems, more secure in case of temporary failure in connection to VPN. Also, when other VPNs are stopped (be it because of failure of underlying network connection or because VPN is just switched off) then the original /etc/resolv.conf is restored. Not so with openswan. I get VPN-only DNS nameservers and when VPN terminates, the original /etc/resolv.conf.
Version-Release number of selected component (if applicable):
Did you check if you observe the same behaviour when vpnc is run on the command line not through the network manager?
I tested locally and found that when vpnc is run from command line, the /etc/resolv.conf output is same as what we get with Openswan.
NetworkManager(NM) has the ability to get DNS information from multiple sources. So when vpnc is run through NM, NM takes care of configuring /etc/resolv.conf. Once NM-openswan plugin is ready same behaviour will be observed.
Without NM, Openswan (or vpnc too for that matter) will require looking inside /etc/resolv.conf to find out what is configured there as nameservers to obtain information about DNS servers.
well, there are long issues with vpnc and its script for generating /etc/resolv.conf (some people ended up with chattr +i /etc/resolv.conf and local bind to make DNS working well). However, the result why it doesn't bother me that much is that when vpnc finishes (killall vpnc), original /etc/resolv.conf gets correctly restored. Not so with ipsec so far.
Openswan restores the /etc/resolv.conf correctly if one stops it by doing:
service ipsec stop
However, if Openswan (ipsec) crahses (due to some issues) then it does not restore the /etc/resolv.conf . So are you referring the case when Openswan crashes?
(In reply to comment #5)
> Openswan restores the /etc/resolv.conf correctly if one stops it by doing:
> service ipsec stop
> However, if Openswan (ipsec) crahses (due to some issues) then it does not
> restore the /etc/resolv.conf . So are you referring the case when Openswan
Not only, probably due to some SELinux issues, I don't get /etc/resolv.conf restored even when I run ipsec setup stop.
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.