Bug 592630 - openswan irrevocably corrupts /etc/resolv.conf
Summary: openswan irrevocably corrupts /etc/resolv.conf
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openswan   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Avesh Agarwal
QA Contact: Aleš Mareček
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-15 20:11 UTC by Matěj Cepl
Modified: 2010-11-11 14:52 UTC (History)
2 users (show)

Fixed In Version: openswan-2_6_24-4_el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-11-11 14:52:13 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Matěj Cepl 2010-05-15 20:11:04 UTC
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
domain redhat.com
search redhat.com

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):

How reproducible:

Comment 2 Avesh Agarwal 2010-05-18 14:20:13 UTC
Did you check if you observe the same behaviour when vpnc is run on the command line not through the network manager?

Comment 3 Avesh Agarwal 2010-05-18 15:17:06 UTC
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.

Comment 4 Matěj Cepl 2010-05-18 15:57:24 UTC
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.

Comment 5 Avesh Agarwal 2010-05-18 16:52:26 UTC
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?

Comment 6 Matěj Cepl 2010-05-19 07:42:39 UTC
(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
> crashes?    

Not only, probably due to some SELinux issues, I don't get /etc/resolv.conf restored even when I run ipsec setup stop.

Comment 7 RHEL Product and Program Management 2010-06-07 16:14:16 UTC
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

Comment 14 releng-rhel@redhat.com 2010-11-11 14:52:13 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.