Can anyone please help me identify where the DNS dynamic servers of 8.8.8.8 / 8.8.4.4 are coming from in IP > DNS on my RB2011? This is what I see:
From what I understand the dynamic servers would be obtained from an interface which uses the DHCP client. I have checked and the only interface using the DHCP client is ether1-gateway, but ether1-gateway doesn’t use the above DNS servers (it uses 192.168.0.1):
Any ideas where the dynamic servers are coming from?
Basically, I want to make the RB2011 use different DNS servers than the ones listed.
As you said, it seems these dynamic servers must be coming from the OpenVPN client connection that we are using for VPN access - is there any way to identify if this is where the DNS servers are coming from? And do we have any way of stopping the RB2011 from using the DNS servers provided by a VPN connection?
Our ISP provides DNS servers via DHCP. When we establish a PPP connection to a VPN that connection also provides DNS servers. We would like the PPP/VPN connection’s DNS servers to take priority over the ISP’s servers when the VPN is active. Is it possible to make the VPN provider’s DNS servers take priority? Currently when we connect to the VPN the list of dynamic servers in IP > DNS looks like this:
<ISP primary DNS server>
<ISP secondary DNS server>
<VPN DNS server>
It would be great if we could either force
<VPN DNS server>
to the top of the list, or remove both of the ISP’s DNS servers while the VPN connection is active.
/ppp profile
add name=profile1 on-down="/ip dhcp-client set [find where interface=ether1] use-peer-dns=yes" \
on-up="/ip dhcp-client set [find where interface=ether1] use-peer-dns=no"
As a safety measure, make sure to re-enable the DNS after reboot.
/system scheduler
add name=enable-dns on-event="/ip dhcp-client set [find where interface=ether1] use-peer-dns=yes" policy=read,write start-time=startup