# vpnc and resolv.conf?

## bjorntj

Is there a way to make vpnc not change dns servers when connected?

I don't want vpnc to change my resolv.conf, is this possible?

Regards,

BTJ

----------

## zatalian

I have the exact opposite problem.

vpnc does not want to change resolv.conf

I read the vpnc wiki that suggests installing a nameserver to solve the problem, but if it is possible to do it without it, like you describe, i would like to know how...

----------

## bjorntj

 *zatalian wrote:*   

> I have the exact opposite problem.
> 
> vpnc does not want to change resolv.conf
> 
> I read the vpnc wiki that suggests installing a nameserver to solve the problem, but if it is possible to do it without it, like you describe, i would like to know how...

 

Well, I haven't done anything except for installing vpnc and using default options..

BTJ

----------

## zatalian

This is what i just figured out : 

 if /etc/resolv.conf is linked to /etc/resolvconf/run/resolv.conf then it is automatically updated.

I still had a non linked /etc/resolv.conf so it did not update.

to bad /etc/resolvconf/run/resolv.conf does not solve my problems. It looks like i need dnsmasq...

----------

## bjorntj

 *zatalian wrote:*   

> This is what i just figured out : 
> 
>  if /etc/resolv.conf is linked to /etc/resolvconf/run/resolv.conf then it is automatically updated.
> 
> I still had a non linked /etc/resolv.conf so it did not update.
> ...

 

Hmmm... I don't have a directory named resolvconf under etc....

BTJ

----------

## Princess Nell

bjorntj: I've taken the session management script from

http://www.gentoo.org/doc/en/vpnc-howto.xml

and modified it so save resolv.conf before running vpnc, then restore it.

----------

## bjorntj

 *Princess Nell wrote:*   

> bjorntj: I've taken the session management script from
> 
> http://www.gentoo.org/doc/en/vpnc-howto.xml
> 
> and modified it so save resolv.conf before running vpnc, then restore it.

 '

I have made my own script trying to copy the old resolv.conf over the new, but it doesn't work... But I finally figured why.....

I have an alias called cp, that includes the -i argument, so no wonder it didn't work.. Using the cp program instead of the alias solved it...  :Smile: 

BTJ

----------

