What's new

Solved How to check the DNS IP address pushed by the OpenVPN?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Yota

Very Senior Member
I'm writing a custom script about running a second instance of dnsmasq, and I want the second instance to use the default DNS server provided by the OVPN client, but because OVPN provider assigns a new DNS IP address every time it starts up,

So I'm wondering where I can check that IP address?

The only thing I've noticed so far is the push messages that exist in the syslog every time OVPN starts up.
Code:
ovpn-client2[10778]: PUSH: Received control message: 'PUSH_REPLY,sndbuf 393216,rcvbuf 393216,redirect-gateway def1,dhcp-option DNS 10.8.0.1,block-outside-dns,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 60,socket-flags TCP_NODELAY,ifconfig 10.8.0.31 255.255.0.0,peer-id 25,cipher AES-256-GCM'

I've tried checking the output of nvram and ifconfig, and I don't find the DNS server pushed from OVPN.
Code:
tun12     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.8.0.31  P-t-P:10.8.0.31  Mask:255.255.0.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


Even after OVPN starts, there is no such file /etc/openvpn/client2/client.resolv in my system. This may be related to my setting Accept DNS Configuration to Disabled. I must to disable this option because I didn't want everyone to use that DNS, only special clients and programs to use the DNS from OVPN via the second dnsmasq instance.

Any ideas other than crawling the syslog?
 
Last edited:
Well, I'll mark this as solved, because I found a way, using OpenVPN's custom script that can pass the DNS as an argument when the OVPN client starts.


But this is not an elegant solution in my opinion.

Hopefully there's a place out there where I can check the current tunnel status info, so I can just get the DNS info I need.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top