# [solved]dnsmasq dislikes VPN

## toralf

Hello,

dnsmasq works fine with this /etc/resolv.conf:

```
nameserver 127.0.0.1

nameserver <1st name server of my company>

nameserver <2nd name server of my company>
```

as long as I'm in the LAN at my office. At home however a similar resolv.conf doesn't work.[update]What I mean, is that names of my company aren't resolved./update At home I dial-in into my ISP (DSL) and after that I open a VPN connection to my company. The resolv.conf at home looks like this :

```
nameserver 127.0.0.1

nameserver <1st name server of my company>

nameserver <2nd name server of my company>

nameserver <1st name server of my ISP>

nameserver <2nd name server of my ISP>
```

I'm arguing that the tun0 interface might be the problem.

Do I need dedicated iptables rules for this case ?Last edited by toralf on Wed Mar 03, 2010 6:47 pm; edited 2 times in total

----------

## Rexilion

In the second resolv.conf, your ISP DNS servers aren't even reached:

       nameserver Name server IP address

              Internet  address  (in  dot  notation) of a name server that the

              resolver  should  query.   Up  to  MAXNS   (currently   3,   see

              <resolv.h>)  name  servers  may  be listed, one per keyword.  If

              there are multiple servers, the resolver library queries them in

              the  order  listed.   If  no nameserver entries are present, the

              default is to use the name server on the  local  machine.   (The

              algorithm  used  is to try a name server, and if the query times

              out, try the next, until out of name servers, then repeat trying

              all  the  name  servers  until  a  maximum number of retries are

              made.)

----------

## toralf

 *Rexilion wrote:*   

> In the second resolv.conf, your ISP DNS servers aren't even reached:

 Right, but that's not my problem.

My problem is, that local names are resolved (defined in /etc/hosts), however names which are defined within office LAN (VPN), aren't resolved, althought dnsmasq forwards these queries (as seen both in /var/log/messages and with wireshark).

Well - I have to _remove_ the ISP name servers from that file before I connect to the VPN and both local and office DNS works ...

----------

