[solved] DNS resolv order (vpn)

Hi to all

i am using OpenWRT x86 virtual to be able to connect some specific site

ok, network is:
wan -> mikrotik ROS -> vlan40 -> clients
so i could not break existing vlan40 to put OpenWRT between clients and mikrotik, instead, it is in same vlan40 with only one interface

so far so good

Mikrotik is 40.1, OpenWRT is 40.2, clients are 40.xx

now, the hard part
i am using openconnect to dial out and eth0 is LAN, openconnect is WAN
still good, everything is working

but ... DNS
to be able for initial connection i need to put 40.1 in lan dns
ok, OpenWRT query the Mikrotik, name is resolved and openconnect succes in connecting
then
openconnect grab 10.2.2.2 and 10.2.3.3 and put them in

cat /tmp/resolv.conf.d/resolv.conf.auto 
# Interface lan
nameserver 192.168.40.1
# Interface wan
nameserver 10.2.2.2
nameserver 10.2.2.3

and here is the problem
if i try to use OpenWRT as resolver from some client PC 40.xx

nslookup exa02.somedomain.whatever 192.168.40.2

OpenWRT first ask 40.1 and get negative response

how can i change order of name servers ?

if i modify by hand
/tmp/resolv.conf.d/resolv.conf.auto
and remove 40.1 from list, then everything works as expected

some ideas ?

then instruct your DNS server to use this address for specific domain only:
DNS forwardings: /example.org/x.x.40.1

You don't need to configure "lan dns".

hi @AndrewZ

tnx
i was so occupied with stupid network design & routing that i miss this obvious solution

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.