Thank you rbattle1...
I have tried to edit the resolv.conf using vi editor But as I am student I dont know about the creation of script for this?
My Os is RHEL6
This is the resolv.conf which U will get clear idea
sorry for the delay
#Resolv.conf before vpnc start
--------------------------------------
[root@tstdpigw02 etc]# more resolv.conf
# Generated by NetworkManager
domain dev-dpi.india.blazer.com
search dev-dpi.india.blazer.com
nameserver 172.16.2.1
nameserver 172.16.2.3
[root@tstdpigw02 etc]# service vpnc start
Starting VPNC connection: VPNC started in background (pid: 2230)...
# Resolv.conf after vpnc start
--------------------------------
[root@tstdpigw02 etc]# more resolv.conf
#@VPNC_GENERATED@ -- this file is generated by vpnc
# and will be overwritten by vpnc
# as long as the above mark is intact
# Generated by NetworkManager
domain usdev.harley.com
search dev-dpi.india.blazer.com
nameserver 10.0.1.7
#Required resolv.conf after vpnc start
----------------------------------------
[root@tstdpigw02 etc]# more resolv.conf.required
#@VPNC_GENERATED@ -- this file is generated by vpnc
# and will be overwritten by vpnc
# as long as the above mark is intact
# Generated by NetworkManager
domain usdev.harley.com
search dev-dpi.india.blazer.com usdev.harley.com
nameserver 172.16.2.1
---------- Post updated 06-02-14 at 12:16 AM ---------- Previous update was 06-01-14 at 11:46 PM ----------
#Resolv.conf before vpnc start
--------------------------------------
[root@tstdpigw02 etc]# more resolv.conf
# Generated by NetworkManager
domain dev-dpi.india.blazer.com
search dev-dpi.india.blazer.com
nameserver 172.16.2.1
nameserver 172.16.2.3
[root@tstdpigw02 etc]# service vpnc start
Starting VPNC connection: VPNC started in background (pid: 2230)...
# Resolv.conf after vpnc start
--------------------------------
[root@tstdpigw02 etc]# more resolv.conf
#@VPNC_GENERATED@ -- this file is generated by vpnc
# and will be overwritten by vpnc
# as long as the above mark is intact
# Generated by NetworkManager
domain usdev.harley.com
search dev-dpi.india.blazer.com
nameserver 10.0.1.7
#Required resolv.conf after vpnc start
----------------------------------------
[root@tstdpigw02 etc]# more resolv.conf.required
#@VPNC_GENERATED@ -- this file is generated by vpnc
# and will be overwritten by vpnc
# as long as the above mark is intact
# Generated by NetworkManager
domain usdev.harley.com
search dev-dpi.india.blazer.com usdev.harley.com
nameserver 172.16.2.1