block outside dns, fix dns leak ubuntu 18.04
up vote
6
down vote
favorite
Using dns leak test while under my VPN I discovered that it was leaking. I've setup my VPN via NetworkManager and it works properly except for the leak.
First, i've tried to add block-outside-vpn
to the configuration file except that under /etc/NetworkManager/system-connections
it does not follow the same format. I couldn't find the doc on how to properly write one for dns leaks.
Also, using Ubuntu 18.04 resolv.conf does not work like before, all the other answers are based on that.
Briefly, how to block outside dns (leak) using Network Manager configuration files or the GUI?
networking 18.04 network-manager dns vpn
add a comment |
up vote
6
down vote
favorite
Using dns leak test while under my VPN I discovered that it was leaking. I've setup my VPN via NetworkManager and it works properly except for the leak.
First, i've tried to add block-outside-vpn
to the configuration file except that under /etc/NetworkManager/system-connections
it does not follow the same format. I couldn't find the doc on how to properly write one for dns leaks.
Also, using Ubuntu 18.04 resolv.conf does not work like before, all the other answers are based on that.
Briefly, how to block outside dns (leak) using Network Manager configuration files or the GUI?
networking 18.04 network-manager dns vpn
block-outside-vpn
typically is only a Windows OpenVPN connection option. Fixing the DNS "leakage" would be to use a specific DNS server that exists only on the other side of the VPN. What were the DNS Leak Test results you saw? (they're relevant)
– Thomas Ward♦
Nov 15 at 21:22
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
Using dns leak test while under my VPN I discovered that it was leaking. I've setup my VPN via NetworkManager and it works properly except for the leak.
First, i've tried to add block-outside-vpn
to the configuration file except that under /etc/NetworkManager/system-connections
it does not follow the same format. I couldn't find the doc on how to properly write one for dns leaks.
Also, using Ubuntu 18.04 resolv.conf does not work like before, all the other answers are based on that.
Briefly, how to block outside dns (leak) using Network Manager configuration files or the GUI?
networking 18.04 network-manager dns vpn
Using dns leak test while under my VPN I discovered that it was leaking. I've setup my VPN via NetworkManager and it works properly except for the leak.
First, i've tried to add block-outside-vpn
to the configuration file except that under /etc/NetworkManager/system-connections
it does not follow the same format. I couldn't find the doc on how to properly write one for dns leaks.
Also, using Ubuntu 18.04 resolv.conf does not work like before, all the other answers are based on that.
Briefly, how to block outside dns (leak) using Network Manager configuration files or the GUI?
networking 18.04 network-manager dns vpn
networking 18.04 network-manager dns vpn
edited Aug 15 at 12:56
asked Aug 15 at 12:47
Pobe
968
968
block-outside-vpn
typically is only a Windows OpenVPN connection option. Fixing the DNS "leakage" would be to use a specific DNS server that exists only on the other side of the VPN. What were the DNS Leak Test results you saw? (they're relevant)
– Thomas Ward♦
Nov 15 at 21:22
add a comment |
block-outside-vpn
typically is only a Windows OpenVPN connection option. Fixing the DNS "leakage" would be to use a specific DNS server that exists only on the other side of the VPN. What were the DNS Leak Test results you saw? (they're relevant)
– Thomas Ward♦
Nov 15 at 21:22
block-outside-vpn
typically is only a Windows OpenVPN connection option. Fixing the DNS "leakage" would be to use a specific DNS server that exists only on the other side of the VPN. What were the DNS Leak Test results you saw? (they're relevant)– Thomas Ward♦
Nov 15 at 21:22
block-outside-vpn
typically is only a Windows OpenVPN connection option. Fixing the DNS "leakage" would be to use a specific DNS server that exists only on the other side of the VPN. What were the DNS Leak Test results you saw? (they're relevant)– Thomas Ward♦
Nov 15 at 21:22
add a comment |
5 Answers
5
active
oldest
votes
up vote
2
down vote
I suggest using dnscrypt
.
First install it:
sudo apt install dnscrypt-proxy
By default it will listens to 127.0.2.1
port 53
.
Edit your VPN or any other connection you like and set 127.0.2.1
as its DNS server, using CLI you can run:
nmcli connection modify [CONNECTION-NAME] ipv4.dns 127.0.2.1
And just in case block the out going DNS requests:
sudo ufw deny out 53
And make sure firewall is enabled:
sudo ufw enable
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
Run this command:nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.
– Ravexina
Aug 22 at 15:20
add a comment |
up vote
2
down vote
If you have a DNS leak as indicated by checking on
browserleaks.com or dnsleaktest.com,
Shut off your VPN connection
Attempt to undo any .conf file edits you've wasted time already making. If you've been trying a lot of various suggestions, your best good chance might be to do a fresh install and ensure you've also installed networkmanager-openvpn-gnome as Ubuntu does not have VPN config importing provided by default.
Install dnsmasq
sudo apt update
sudo apt install dnsmasq
Disable resolved
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Remove /
etc/resolv.conf
and create a new one:
sudo rm /etc/resolv.conf
sudo nano /etc/resolv.conf
Enter into your empty
.conf
file:
nameserver 127.0.0.1` that's all!
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite your new
resolv.conf
file.
Edit your NetworkManager.conf file
sudo nano /etc/NetworkManager/NetworkManager.conf
and add the following:
dns=dnsmasq
beneath the lines (navigate using arrow keys), [main] and plugins=ifupdown, keyfile exactly like this with the new line added.
[main]
plugins=ifupdown, keyfile
dns=dnsmasq
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite the file.
Back out of the terminal, and reboot the system and check your dnsleak test site for results.
With thanks to Anonymous VPN whose solutions for Leaks on Ubuntu/Network Manager seem well researched and successful. THEY WORK and when no other solutions worked for me, these did. The above shown solution works for Ubuntu 17.x and 18.04 LTS. See his other solution for 16.04 LTS.
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VMnameserver
changed from127.0.2.1
to192.168.122.1
and when I connect to VPN in aresolv.conf
I see twonameserver
lines, one with192.168.122.1
and the other with VPNs dns but on a main machine I always see two linessearch lan nameserver 127.0.1.1
.
– GoodGuyNick
Sep 23 at 12:56
add a comment |
up vote
1
down vote
To fix DNS leaks on Ubuntu 18.04, you can edit a file called /etc/dhcp/dhclient.conf
. According to the manual page, this file "provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address."
As for fixing your DNS leaks, we will be editing this file. Opening it with the proper permissions, you will see a commented line that looks something like this:
#prepend domain-name-servers 127.0.0.53;
Uncomment this line, and change the domain-name-server to a different one, such as OpenDNS: 208.67.222.222. Using this OpenDNS address, this line would now look like this:
prepend domain-name-servers 208.67.222.222;
After saving the file and rebooting your system, this should fix the DNS leaks on Ubuntu 18.04.
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
add a comment |
up vote
0
down vote
Try using the update-systemd-resolved
script that does not make changes to the resolv.conf
, and instead uses the systemd-resolved
service using it's DBus API
Get it from git and install it by:
git clone https://github.com/aghorler/update-systemd-resolved.git
cd update-systemd-resolved
make
Now edit nsswitch.conf
by:
sudo nano /etc/nsswitch.conf
and then change the line starting with hosts:
to say
hosts: files resolve dns myhostname
Enable the service and make sure it's running automatically:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
NOTE: If you don't want to follow the above steps and you're okay with using the terminal, the DNS leak only occurs when using
NetworkManager, it so far in my experience does not happen when you
run openvpn from the terminal withsudo openvpn --config config.ovpn
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
add a comment |
up vote
0
down vote
I have tried just about every solution I could find online to fix the dns leak problem. Openvpn started just fine but showed that it was leaking when I went to the test sites. After I got no joy trying all the remedies, I went into my wifi and ethernet setting and used openvpn's dns servers instead of my ISP's and everything was fine from then on. I'm sure you've seen the ip addresses all over the place but here they are if you haven't: 208.67.222.222 and 208.67.220.220.
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
I suggest using dnscrypt
.
First install it:
sudo apt install dnscrypt-proxy
By default it will listens to 127.0.2.1
port 53
.
Edit your VPN or any other connection you like and set 127.0.2.1
as its DNS server, using CLI you can run:
nmcli connection modify [CONNECTION-NAME] ipv4.dns 127.0.2.1
And just in case block the out going DNS requests:
sudo ufw deny out 53
And make sure firewall is enabled:
sudo ufw enable
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
Run this command:nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.
– Ravexina
Aug 22 at 15:20
add a comment |
up vote
2
down vote
I suggest using dnscrypt
.
First install it:
sudo apt install dnscrypt-proxy
By default it will listens to 127.0.2.1
port 53
.
Edit your VPN or any other connection you like and set 127.0.2.1
as its DNS server, using CLI you can run:
nmcli connection modify [CONNECTION-NAME] ipv4.dns 127.0.2.1
And just in case block the out going DNS requests:
sudo ufw deny out 53
And make sure firewall is enabled:
sudo ufw enable
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
Run this command:nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.
– Ravexina
Aug 22 at 15:20
add a comment |
up vote
2
down vote
up vote
2
down vote
I suggest using dnscrypt
.
First install it:
sudo apt install dnscrypt-proxy
By default it will listens to 127.0.2.1
port 53
.
Edit your VPN or any other connection you like and set 127.0.2.1
as its DNS server, using CLI you can run:
nmcli connection modify [CONNECTION-NAME] ipv4.dns 127.0.2.1
And just in case block the out going DNS requests:
sudo ufw deny out 53
And make sure firewall is enabled:
sudo ufw enable
I suggest using dnscrypt
.
First install it:
sudo apt install dnscrypt-proxy
By default it will listens to 127.0.2.1
port 53
.
Edit your VPN or any other connection you like and set 127.0.2.1
as its DNS server, using CLI you can run:
nmcli connection modify [CONNECTION-NAME] ipv4.dns 127.0.2.1
And just in case block the out going DNS requests:
sudo ufw deny out 53
And make sure firewall is enabled:
sudo ufw enable
answered Aug 17 at 17:52
Ravexina
30.6k1478106
30.6k1478106
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
Run this command:nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.
– Ravexina
Aug 22 at 15:20
add a comment |
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
Run this command:nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.
– Ravexina
Aug 22 at 15:20
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
My DNS is still leaking as per DNS leak test. It's also important to mention that disabling VPN while ufw is enabled would render internet unavailable (blocked port 53).
– Pobe
Aug 22 at 14:07
Run this command:
nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.– Ravexina
Aug 22 at 15:20
Run this command:
nmcli connection modify [CONNECTION-NAME] ipv4.ignore-auto-dns yes
see if it helps.– Ravexina
Aug 22 at 15:20
add a comment |
up vote
2
down vote
If you have a DNS leak as indicated by checking on
browserleaks.com or dnsleaktest.com,
Shut off your VPN connection
Attempt to undo any .conf file edits you've wasted time already making. If you've been trying a lot of various suggestions, your best good chance might be to do a fresh install and ensure you've also installed networkmanager-openvpn-gnome as Ubuntu does not have VPN config importing provided by default.
Install dnsmasq
sudo apt update
sudo apt install dnsmasq
Disable resolved
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Remove /
etc/resolv.conf
and create a new one:
sudo rm /etc/resolv.conf
sudo nano /etc/resolv.conf
Enter into your empty
.conf
file:
nameserver 127.0.0.1` that's all!
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite your new
resolv.conf
file.
Edit your NetworkManager.conf file
sudo nano /etc/NetworkManager/NetworkManager.conf
and add the following:
dns=dnsmasq
beneath the lines (navigate using arrow keys), [main] and plugins=ifupdown, keyfile exactly like this with the new line added.
[main]
plugins=ifupdown, keyfile
dns=dnsmasq
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite the file.
Back out of the terminal, and reboot the system and check your dnsleak test site for results.
With thanks to Anonymous VPN whose solutions for Leaks on Ubuntu/Network Manager seem well researched and successful. THEY WORK and when no other solutions worked for me, these did. The above shown solution works for Ubuntu 17.x and 18.04 LTS. See his other solution for 16.04 LTS.
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VMnameserver
changed from127.0.2.1
to192.168.122.1
and when I connect to VPN in aresolv.conf
I see twonameserver
lines, one with192.168.122.1
and the other with VPNs dns but on a main machine I always see two linessearch lan nameserver 127.0.1.1
.
– GoodGuyNick
Sep 23 at 12:56
add a comment |
up vote
2
down vote
If you have a DNS leak as indicated by checking on
browserleaks.com or dnsleaktest.com,
Shut off your VPN connection
Attempt to undo any .conf file edits you've wasted time already making. If you've been trying a lot of various suggestions, your best good chance might be to do a fresh install and ensure you've also installed networkmanager-openvpn-gnome as Ubuntu does not have VPN config importing provided by default.
Install dnsmasq
sudo apt update
sudo apt install dnsmasq
Disable resolved
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Remove /
etc/resolv.conf
and create a new one:
sudo rm /etc/resolv.conf
sudo nano /etc/resolv.conf
Enter into your empty
.conf
file:
nameserver 127.0.0.1` that's all!
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite your new
resolv.conf
file.
Edit your NetworkManager.conf file
sudo nano /etc/NetworkManager/NetworkManager.conf
and add the following:
dns=dnsmasq
beneath the lines (navigate using arrow keys), [main] and plugins=ifupdown, keyfile exactly like this with the new line added.
[main]
plugins=ifupdown, keyfile
dns=dnsmasq
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite the file.
Back out of the terminal, and reboot the system and check your dnsleak test site for results.
With thanks to Anonymous VPN whose solutions for Leaks on Ubuntu/Network Manager seem well researched and successful. THEY WORK and when no other solutions worked for me, these did. The above shown solution works for Ubuntu 17.x and 18.04 LTS. See his other solution for 16.04 LTS.
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VMnameserver
changed from127.0.2.1
to192.168.122.1
and when I connect to VPN in aresolv.conf
I see twonameserver
lines, one with192.168.122.1
and the other with VPNs dns but on a main machine I always see two linessearch lan nameserver 127.0.1.1
.
– GoodGuyNick
Sep 23 at 12:56
add a comment |
up vote
2
down vote
up vote
2
down vote
If you have a DNS leak as indicated by checking on
browserleaks.com or dnsleaktest.com,
Shut off your VPN connection
Attempt to undo any .conf file edits you've wasted time already making. If you've been trying a lot of various suggestions, your best good chance might be to do a fresh install and ensure you've also installed networkmanager-openvpn-gnome as Ubuntu does not have VPN config importing provided by default.
Install dnsmasq
sudo apt update
sudo apt install dnsmasq
Disable resolved
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Remove /
etc/resolv.conf
and create a new one:
sudo rm /etc/resolv.conf
sudo nano /etc/resolv.conf
Enter into your empty
.conf
file:
nameserver 127.0.0.1` that's all!
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite your new
resolv.conf
file.
Edit your NetworkManager.conf file
sudo nano /etc/NetworkManager/NetworkManager.conf
and add the following:
dns=dnsmasq
beneath the lines (navigate using arrow keys), [main] and plugins=ifupdown, keyfile exactly like this with the new line added.
[main]
plugins=ifupdown, keyfile
dns=dnsmasq
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite the file.
Back out of the terminal, and reboot the system and check your dnsleak test site for results.
With thanks to Anonymous VPN whose solutions for Leaks on Ubuntu/Network Manager seem well researched and successful. THEY WORK and when no other solutions worked for me, these did. The above shown solution works for Ubuntu 17.x and 18.04 LTS. See his other solution for 16.04 LTS.
If you have a DNS leak as indicated by checking on
browserleaks.com or dnsleaktest.com,
Shut off your VPN connection
Attempt to undo any .conf file edits you've wasted time already making. If you've been trying a lot of various suggestions, your best good chance might be to do a fresh install and ensure you've also installed networkmanager-openvpn-gnome as Ubuntu does not have VPN config importing provided by default.
Install dnsmasq
sudo apt update
sudo apt install dnsmasq
Disable resolved
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Remove /
etc/resolv.conf
and create a new one:
sudo rm /etc/resolv.conf
sudo nano /etc/resolv.conf
Enter into your empty
.conf
file:
nameserver 127.0.0.1` that's all!
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite your new
resolv.conf
file.
Edit your NetworkManager.conf file
sudo nano /etc/NetworkManager/NetworkManager.conf
and add the following:
dns=dnsmasq
beneath the lines (navigate using arrow keys), [main] and plugins=ifupdown, keyfile exactly like this with the new line added.
[main]
plugins=ifupdown, keyfile
dns=dnsmasq
Press Ctrl+x to exit the editor. Enter y to save and then press Enter to overwrite the file.
Back out of the terminal, and reboot the system and check your dnsleak test site for results.
With thanks to Anonymous VPN whose solutions for Leaks on Ubuntu/Network Manager seem well researched and successful. THEY WORK and when no other solutions worked for me, these did. The above shown solution works for Ubuntu 17.x and 18.04 LTS. See his other solution for 16.04 LTS.
edited Nov 18 at 16:24
answered Aug 25 at 20:08
Dosenfleisch
315
315
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VMnameserver
changed from127.0.2.1
to192.168.122.1
and when I connect to VPN in aresolv.conf
I see twonameserver
lines, one with192.168.122.1
and the other with VPNs dns but on a main machine I always see two linessearch lan nameserver 127.0.1.1
.
– GoodGuyNick
Sep 23 at 12:56
add a comment |
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VMnameserver
changed from127.0.2.1
to192.168.122.1
and when I connect to VPN in aresolv.conf
I see twonameserver
lines, one with192.168.122.1
and the other with VPNs dns but on a main machine I always see two linessearch lan nameserver 127.0.1.1
.
– GoodGuyNick
Sep 23 at 12:56
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VM
nameserver
changed from 127.0.2.1
to 192.168.122.1
and when I connect to VPN in a resolv.conf
I see two nameserver
lines, one with 192.168.122.1
and the other with VPNs dns but on a main machine I always see two lines search lan nameserver 127.0.1.1
.– GoodGuyNick
Sep 23 at 12:56
I've tested this solution on a VM and all worked. Then I've tried on a main machine and saw dns from VPN and dns leak. On a VM
nameserver
changed from 127.0.2.1
to 192.168.122.1
and when I connect to VPN in a resolv.conf
I see two nameserver
lines, one with 192.168.122.1
and the other with VPNs dns but on a main machine I always see two lines search lan nameserver 127.0.1.1
.– GoodGuyNick
Sep 23 at 12:56
add a comment |
up vote
1
down vote
To fix DNS leaks on Ubuntu 18.04, you can edit a file called /etc/dhcp/dhclient.conf
. According to the manual page, this file "provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address."
As for fixing your DNS leaks, we will be editing this file. Opening it with the proper permissions, you will see a commented line that looks something like this:
#prepend domain-name-servers 127.0.0.53;
Uncomment this line, and change the domain-name-server to a different one, such as OpenDNS: 208.67.222.222. Using this OpenDNS address, this line would now look like this:
prepend domain-name-servers 208.67.222.222;
After saving the file and rebooting your system, this should fix the DNS leaks on Ubuntu 18.04.
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
add a comment |
up vote
1
down vote
To fix DNS leaks on Ubuntu 18.04, you can edit a file called /etc/dhcp/dhclient.conf
. According to the manual page, this file "provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address."
As for fixing your DNS leaks, we will be editing this file. Opening it with the proper permissions, you will see a commented line that looks something like this:
#prepend domain-name-servers 127.0.0.53;
Uncomment this line, and change the domain-name-server to a different one, such as OpenDNS: 208.67.222.222. Using this OpenDNS address, this line would now look like this:
prepend domain-name-servers 208.67.222.222;
After saving the file and rebooting your system, this should fix the DNS leaks on Ubuntu 18.04.
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
add a comment |
up vote
1
down vote
up vote
1
down vote
To fix DNS leaks on Ubuntu 18.04, you can edit a file called /etc/dhcp/dhclient.conf
. According to the manual page, this file "provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address."
As for fixing your DNS leaks, we will be editing this file. Opening it with the proper permissions, you will see a commented line that looks something like this:
#prepend domain-name-servers 127.0.0.53;
Uncomment this line, and change the domain-name-server to a different one, such as OpenDNS: 208.67.222.222. Using this OpenDNS address, this line would now look like this:
prepend domain-name-servers 208.67.222.222;
After saving the file and rebooting your system, this should fix the DNS leaks on Ubuntu 18.04.
To fix DNS leaks on Ubuntu 18.04, you can edit a file called /etc/dhcp/dhclient.conf
. According to the manual page, this file "provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address."
As for fixing your DNS leaks, we will be editing this file. Opening it with the proper permissions, you will see a commented line that looks something like this:
#prepend domain-name-servers 127.0.0.53;
Uncomment this line, and change the domain-name-server to a different one, such as OpenDNS: 208.67.222.222. Using this OpenDNS address, this line would now look like this:
prepend domain-name-servers 208.67.222.222;
After saving the file and rebooting your system, this should fix the DNS leaks on Ubuntu 18.04.
answered Sep 22 at 13:06
Stone
111
111
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
add a comment |
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
Or you could just edit your connection in a GUI and get the same result: open edit window for your connection=>IPv4/IPv6 Settings, change "Method" to "Automatic, addresses only" and add yours "DNS servers".
– GoodGuyNick
Sep 23 at 13:35
add a comment |
up vote
0
down vote
Try using the update-systemd-resolved
script that does not make changes to the resolv.conf
, and instead uses the systemd-resolved
service using it's DBus API
Get it from git and install it by:
git clone https://github.com/aghorler/update-systemd-resolved.git
cd update-systemd-resolved
make
Now edit nsswitch.conf
by:
sudo nano /etc/nsswitch.conf
and then change the line starting with hosts:
to say
hosts: files resolve dns myhostname
Enable the service and make sure it's running automatically:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
NOTE: If you don't want to follow the above steps and you're okay with using the terminal, the DNS leak only occurs when using
NetworkManager, it so far in my experience does not happen when you
run openvpn from the terminal withsudo openvpn --config config.ovpn
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
add a comment |
up vote
0
down vote
Try using the update-systemd-resolved
script that does not make changes to the resolv.conf
, and instead uses the systemd-resolved
service using it's DBus API
Get it from git and install it by:
git clone https://github.com/aghorler/update-systemd-resolved.git
cd update-systemd-resolved
make
Now edit nsswitch.conf
by:
sudo nano /etc/nsswitch.conf
and then change the line starting with hosts:
to say
hosts: files resolve dns myhostname
Enable the service and make sure it's running automatically:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
NOTE: If you don't want to follow the above steps and you're okay with using the terminal, the DNS leak only occurs when using
NetworkManager, it so far in my experience does not happen when you
run openvpn from the terminal withsudo openvpn --config config.ovpn
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
add a comment |
up vote
0
down vote
up vote
0
down vote
Try using the update-systemd-resolved
script that does not make changes to the resolv.conf
, and instead uses the systemd-resolved
service using it's DBus API
Get it from git and install it by:
git clone https://github.com/aghorler/update-systemd-resolved.git
cd update-systemd-resolved
make
Now edit nsswitch.conf
by:
sudo nano /etc/nsswitch.conf
and then change the line starting with hosts:
to say
hosts: files resolve dns myhostname
Enable the service and make sure it's running automatically:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
NOTE: If you don't want to follow the above steps and you're okay with using the terminal, the DNS leak only occurs when using
NetworkManager, it so far in my experience does not happen when you
run openvpn from the terminal withsudo openvpn --config config.ovpn
Try using the update-systemd-resolved
script that does not make changes to the resolv.conf
, and instead uses the systemd-resolved
service using it's DBus API
Get it from git and install it by:
git clone https://github.com/aghorler/update-systemd-resolved.git
cd update-systemd-resolved
make
Now edit nsswitch.conf
by:
sudo nano /etc/nsswitch.conf
and then change the line starting with hosts:
to say
hosts: files resolve dns myhostname
Enable the service and make sure it's running automatically:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service
NOTE: If you don't want to follow the above steps and you're okay with using the terminal, the DNS leak only occurs when using
NetworkManager, it so far in my experience does not happen when you
run openvpn from the terminal withsudo openvpn --config config.ovpn
answered Aug 17 at 18:03
Amith KK
10.2k1153111
10.2k1153111
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
add a comment |
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
What would be the line in config.ovpn that would block the leak? Do you have an example of that? (The solution above did not work for me).
– Pobe
Aug 22 at 14:36
add a comment |
up vote
0
down vote
I have tried just about every solution I could find online to fix the dns leak problem. Openvpn started just fine but showed that it was leaking when I went to the test sites. After I got no joy trying all the remedies, I went into my wifi and ethernet setting and used openvpn's dns servers instead of my ISP's and everything was fine from then on. I'm sure you've seen the ip addresses all over the place but here they are if you haven't: 208.67.222.222 and 208.67.220.220.
add a comment |
up vote
0
down vote
I have tried just about every solution I could find online to fix the dns leak problem. Openvpn started just fine but showed that it was leaking when I went to the test sites. After I got no joy trying all the remedies, I went into my wifi and ethernet setting and used openvpn's dns servers instead of my ISP's and everything was fine from then on. I'm sure you've seen the ip addresses all over the place but here they are if you haven't: 208.67.222.222 and 208.67.220.220.
add a comment |
up vote
0
down vote
up vote
0
down vote
I have tried just about every solution I could find online to fix the dns leak problem. Openvpn started just fine but showed that it was leaking when I went to the test sites. After I got no joy trying all the remedies, I went into my wifi and ethernet setting and used openvpn's dns servers instead of my ISP's and everything was fine from then on. I'm sure you've seen the ip addresses all over the place but here they are if you haven't: 208.67.222.222 and 208.67.220.220.
I have tried just about every solution I could find online to fix the dns leak problem. Openvpn started just fine but showed that it was leaking when I went to the test sites. After I got no joy trying all the remedies, I went into my wifi and ethernet setting and used openvpn's dns servers instead of my ISP's and everything was fine from then on. I'm sure you've seen the ip addresses all over the place but here they are if you haven't: 208.67.222.222 and 208.67.220.220.
answered Nov 15 at 20:50
John LaFramboise
1
1
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1065568%2fblock-outside-dns-fix-dns-leak-ubuntu-18-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
block-outside-vpn
typically is only a Windows OpenVPN connection option. Fixing the DNS "leakage" would be to use a specific DNS server that exists only on the other side of the VPN. What were the DNS Leak Test results you saw? (they're relevant)– Thomas Ward♦
Nov 15 at 21:22