Setup DNS Name resolution

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read this

Setup DNS Name resolution

Postby espressoguy on Sat Apr 14, 2012 12:51 pm

I changed all my vpn settings to read the following DNS settings
208.67.222.222, 208.67.220.220

When I run this command in terminal
$ cat /etc/resolv.conf
I get the following information

# Generated by NetworkManager
domain gateway.2wire.net
search gateway.2wire.net
nameserver 208.67.222.222 This is a public DNS
nameserver 192.168.xxx.xxxThis belongs to my ISP

How do I change that DNS to, say, 208.67.220.220
Can I use the instructions below??



Setup DNS Name resolution

Steps to configure Linux as DNS client, first login as a root user (use su command):

Step # 1: Open /etc/resolv.conf file:

# vi /etc/resolv.conf

Step #2: Add your ISP nameserver as follows:

search isp.com
nameserver 202.54.1.110
nameserver 202.54.1.112
nameserver 202.54.1.115

Note Max. three nameserver can be used/defined at a time.

Step # 3:Test setup nslookup or dig command:

$ dig www.nixcraft.com
$ nslookup www.nixcraft.com
espressoguy
Level 2
Level 2
 
Posts: 62
Joined: Thu Mar 08, 2012 4:36 pm
Location: Planet Earth

Linux Mint is funded by ads and donations.
 

Re: Setup DNS Name resolution

Postby dwasifar on Sat Apr 14, 2012 9:48 pm

That will not work for you. Or, more accurately, it will not stick; the edits to resolv.conf will vanish the next time you boot. This is because you are using Network Manager, which overrides the settings in resolv.conf with its own configured settings each time you boot. You will need to set the DNS servers using Network Manager's configuration tool instead.

If you click on your network connection icon in the panel and choose to edit the connection, you will get an edit window that says "editing auto eth0" (or whatever your connection is named). Go to the IPv4 settings tab and select "Automatic (DHCP) addresses only." This will ungray the settings for DNS servers and search domains. Enter your desired DNS server IPs in the DNS server field, separated by commas. Save and exit. If the network connection doesn't automatically reconnect to apply the new settings, you can reboot, or disable and re-enable your connection from the panel icon.

By the way, the second IP in your resolv.conf is not the IP of your ISP's DNS server; it is a local IP on your network, and if I am reading this right, it's probably the gateway's local address, 192.168.1.254. I'm guessing you're using AT&T. If so, I'd advise you don't include that local gateway address in the list of DNS servers when you configure the connection in Network Manager, because their DNS is slow as frozen snails. Try Google Open DNS instead at 8.8.8.8 or 8.8.4.4 for faster response.
User avatar
dwasifar
Level 4
Level 4
 
Posts: 344
Joined: Mon May 09, 2011 10:03 pm

Re: Setup DNS Name resolution

Postby Habitual on Sun Apr 15, 2012 9:52 am

espressoguy wrote:...
nameserver 208.67.222.222 This is a public DNS
nameserver 192.168.xxx.xxxThis belongs to my ISP...


192. addresses do NOT belong to an ISP.
http://www.faqs.org/rfcs/rfc1918.html
My DorkBlog
Cirrhus9.com - Managed HA VDSs and Scalable grid solutions.
User avatar
Habitual
Level 7
Level 7
 
Posts: 1927
Joined: Sun Nov 21, 2010 8:31 pm
Location: Under the hood

Re: Setup DNS Name resolution

Postby dwasifar on Sun Apr 15, 2012 10:51 am

Habitual wrote:192. addresses do NOT belong to an ISP.


Was there a point to repeating this?
User avatar
dwasifar
Level 4
Level 4
 
Posts: 344
Joined: Mon May 09, 2011 10:03 pm

Re: Setup DNS Name resolution

Postby AlbertP on Sun Apr 15, 2012 11:04 am

It isn't repeated as far as I can see. Probably he double posted by mistake.

192.168.x.x or 10.0.x.x addresses are part of your local network, instead of the web or ISP. IP's starting with anything else are on the public web. Any gateway or DNS address starting with 192.168 most likely points to your router, and the router is configured to pass the data to the ISP.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6504
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: Setup DNS Name resolution

Postby xenopeek on Sun Apr 15, 2012 12:32 pm

Moved here by moderator
Forum Rules | IRC Channel Rules
Image
Arch Linux / 64-bit / Gnome Shell
User avatar
xenopeek
Level 21
Level 21
 
Posts: 13692
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Setup DNS Name resolution

Postby espressoguy on Sun Apr 15, 2012 12:58 pm

dwasifar wrote:If you click on your network connection icon in the panel and choose to edit the connection, you will get an edit window that says "editing auto eth0" (or whatever your connection is named). Go to the IPv4 settings tab and select "Automatic (DHCP) addresses only." This will ungray the settings for DNS servers and search domains. Enter your desired DNS server IPs in the DNS server field, separated by commas. Save and exit. If the network connection doesn't automatically reconnect to apply the new settings, you can reboot, or disable and re-enable your connection from the panel icon.


Yes, thankyou I did this using opendns addresses but I thought Linux didn't leak? This was the sole reason why I switched from Windows. I can prevent dns leaks in windows, basically the same way. My whole purpose was to run openvpn in a linux environment so I could use the "automatic vpn" in the IPv4 settings. Does it have something to do in my firefox settings. I currently have "auto detect proxy setting for this network" ? Please someone help me.

EDIT: I have discovered, through much trial and error that only some of the serveres I connect to leak dns soooooo for those servers I should add dns to IPv4 settings???
espressoguy
Level 2
Level 2
 
Posts: 62
Joined: Thu Mar 08, 2012 4:36 pm
Location: Planet Earth

Re: Setup DNS Name resolution

Postby dwasifar on Sun Apr 15, 2012 6:14 pm

AlbertP wrote:It isn't repeated as far as I can see. Probably he double posted by mistake.


No, I meant, what was the point of his repeating what I had just said, without adding any new information relevant to the OP's question?
User avatar
dwasifar
Level 4
Level 4
 
Posts: 344
Joined: Mon May 09, 2011 10:03 pm

Re: Setup DNS Name resolution

Postby dwasifar on Sun Apr 15, 2012 6:20 pm

espressoguy wrote:Yes, thankyou I did this using opendns addresses but I thought Linux didn't leak? This was the sole reason why I switched from Windows. I can prevent dns leaks in windows, basically the same way. My whole purpose was to run openvpn in a linux environment so I could use the "automatic vpn" in the IPv4 settings. Does it have something to do in my firefox settings. I currently have "auto detect proxy setting for this network" ? Please someone help me.

EDIT: I have discovered, through much trial and error that only some of the serveres I connect to leak dns soooooo for those servers I should add dns to IPv4 settings???


Now I'm confused about what your actual problem is. Are you concerned that not every DNS request your system makes is going to the DNS server you expect? If so, specifying those servers in the connection information field will ensure that the system's DNS requests will go to those servers. Are you worried about some application that makes its own DNS connections without asking the OS to handle it?
User avatar
dwasifar
Level 4
Level 4
 
Posts: 344
Joined: Mon May 09, 2011 10:03 pm

Re: Setup DNS Name resolution

Postby espressoguy on Sun Apr 15, 2012 6:49 pm

If so, specifying those servers in the connection information field will ensure that the system's DNS requests will go to those servers.


I aplogize for my inability to make myself clear :oops:

I want to do, as you say in the above quote.

Do I make the changes in a terminal command - I have no idea how to do this-, or do I make the changes in my IPv4 settings.

network connections----vpn connection-----configure-----automativ vpn (addresses only)-----DNS servers----208.67.222.222

Thank you for your help
espressoguy
Level 2
Level 2
 
Posts: 62
Joined: Thu Mar 08, 2012 4:36 pm
Location: Planet Earth

Re: Setup DNS Name resolution

Postby dwasifar on Sun Apr 15, 2012 8:31 pm

I see.

I am pretty confident that the sequence of actions you just outlined is exactly what you need to do. However, to be honest, I am less experienced with VPN settings than with regular network settings, so you may wish to wait for someone else to come along and confirm that before relying on it.
User avatar
dwasifar
Level 4
Level 4
 
Posts: 344
Joined: Mon May 09, 2011 10:03 pm

Re: Setup DNS Name resolution

Postby s1m0n4 on Fri Sep 20, 2013 8:41 am

Thanks a lot @dwasifar.
The steps you suggested correctly configure VPN too.
s1m0n4
Level 1
Level 1
 
Posts: 1
Joined: Fri Sep 20, 2013 8:34 am

Linux Mint is funded by ads and donations.
 

Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 8 guests