Page 1 of 1

How to setup DNS on Ubuntu?

Posted: Mon Jun 19, 2017 12:07 pm
by Anon4d3
Hello,

I'm new here, it seems that on Ubuntu when I connect to the VPN the DNS leaks, how do I fix that? how to make sure I'm using cryptostorm DNS servers?

Thanks

Re: How to setup DNS on Ubuntu?

Posted: Mon Jun 19, 2017 2:28 pm
by parityboy
@OP

Can you post the content of /etc/resolv.conf? Thanks. ;)

EDIT
Copy this into a script file and then execute it - see if it fixes your issue. :)

Re: How to setup DNS on Ubuntu?

Posted: Mon Jun 19, 2017 10:16 pm
by Anon4d3
parityboy wrote:@OP

Can you post the content of /etc/resolv.conf? Thanks. ;)

EDIT
Copy this into a script file and then execute it - see if it fixes your issue. :)
Thanks for the reply, I've ran that script but sadly I'm still experiencing the same issue.

the content of my resolv.conf is: nameserver 127.0.0.53

just that

Thanks

Re: How to setup DNS on Ubuntu?

Posted: Wed Jun 21, 2017 1:37 am
by parityboy
@OP

OK, so that's wrong. It should read 127.0.0.1. :) OK so do the following:

Code: Select all

cd /etc/resolvconf/resolv.conf.d
cat head
The result should be (based on what you've told me)

Code: Select all

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.53
Edit it so that the address is 127.0.0.1, then run sudo resolvconf -u. Now do

Code: Select all

cd /etc/NetworkManager/dnsmasq.d
cat dnsmasq.conf
The output should be

Code: Select all

listen-address=127.0.0.1
If it isn't, edit it. Then reboot, and see if you get the same problem. :)

Re: How to setup DNS on Ubuntu?

Posted: Wed Jun 21, 2017 6:31 pm
by Anon4d3
parityboy wrote:@OP

OK, so that's wrong. It should read 127.0.0.1. :) OK so do the following:
~
If it isn't, edit it. Then reboot, and see if you get the same problem. :)
Sadly I'm still seeing Google DNS servers instead of CS DNS after following your instructions :/

Re: How to setup DNS on Ubuntu?

Posted: Thu Jun 22, 2017 2:51 am
by parityboy
@OP

When I connect, I get this in /var/log/syslog

Code: Select all

Jun 21 22:35:53 defiant nm-openvpn[11445]: [server] Peer Connection Initiated with [AF_INET]5.101.137.252:443
Jun 21 22:35:56 defiant nm-openvpn[11445]: TUN/TAP device tun0 opened
Jun 21 22:35:56 defiant nm-openvpn[11445]: /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper tun0 1500 1602 10.33.196.122 255.255.0.0 init
Jun 21 22:35:56 defiant NetworkManager[1148]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Jun 21 22:35:56 defiant NetworkManager[1148]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Jun 21 22:35:56 defiant NetworkManager[1148]: <warn> /sys/devices/virtual/net/tun0: couldn't determine device driver; ignoring...
Jun 21 22:35:56 defiant NetworkManager[1148]: <info> VPN connection 'CS ENG' (IP Config Get) reply received.
Jun 21 22:35:56 defiant NetworkManager[1148]: <info> VPN connection 'CS ENG' (IP4 Config Get) reply received.
Jun 21 22:35:56 defiant NetworkManager[1148]: <info> VPN Gateway: 5.101.137.252
Jun 21 22:35:56 defiant NetworkManager[1148]: <info> Tunnel Device: tun0
Jun 21 22:35:56 defiant NetworkManager[1148]: <info> IPv4 configuration:
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Internal Gateway: 10.33.0.1
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Internal Address: 10.33.196.122
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Internal Prefix: 16
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Internal Point-to-Point Address: 0.0.0.0
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Maximum Segment Size (MSS): 0
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Forbid Default Route: no
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   Internal DNS: 5.101.137.251
Jun 21 22:35:56 defiant nm-openvpn[11445]: Initialization Sequence Completed
Jun 21 22:35:56 defiant NetworkManager[1148]: <info>   DNS Domain: '(none)'
Jun 21 22:35:56 defiant NetworkManager[1148]: <info> No IPv6 configuration
Jun 21 22:35:57 defiant NetworkManager[1148]: <info> VPN connection 'CS ENG' (IP Config Get) complete.
Jun 21 22:35:57 defiant NetworkManager[1148]: <info> Policy set 'CS ENG' (tun0) as default for IPv4 routing and DNS.
Jun 21 22:35:57 defiant NetworkManager[1148]: <info> Writing DNS information to /sbin/resolvconf
Jun 21 22:35:57 defiant dnsmasq[2922]: setting upstream servers from DBus
Jun 21 22:35:57 defiant dnsmasq[2922]: using nameserver 5.101.137.251#53
Can you do sudo tail -f /var/log/syslog, connect and then post the log entries here so that we can see what's going on? Thanks.

Re: How to setup DNS on Ubuntu?

Posted: Tue Mar 12, 2019 12:06 pm
by df
The problem here is that the update-resolv-conf script needs to be added to the OpenVPN configs.
https://cryptostorm.is/nix#dnsleak has the instructions