Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 [2] 3

Author Topic: DNS Servers  (Read 22172 times)

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #15 on: May 02, 2012, 09:00:37 PM »

$ ping hubblelkdfjsddskfjsddfg.com
ping: unknown host hubblelkdfjsddskfjsddfg.com
[/code]

And from the other console we can see the udp/53 connection to the nameserver with IP address 8.8.8.8 (as configured in /etc/resolv.conf)..

Code: [Select]
$ sudo netstat -nucp
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 192.168.1.2:60078       8.8.8.8:53              ESTABLISHED 10899/ping     

cheers, a
[/quote]

When I run sudo netstat -nucp - I get this

Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State

and it continues to run until I kill the process   
Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: DNS Servers
« Reply #16 on: May 02, 2012, 09:21:06 PM »

My bad!  It's /etc/resolv.conf (no 'e' on the end). It's just a text file rather than a program to run, so load it with a text editor (e.g. gedit)

My eyesight!  I didn't pick up the correct spelling in your screenshot!

I edited and saved resolv.conf then restarted but on checking it had placed the router DNS addresses above mine in the list.  Thus -

Code: [Select]
nameserver 127.0.0.1
nameserver 194.168.4.100
nameserver 194.168.8.100
nameserver 208.67.222.222
nameserver 208.67.220.220

The 1st line seems correct, the 2nd and 3rd are the Virgin nameservers.  The final 2 are opendns, which is what I want.

Hang on... the first line suggests that there's a DNS server (bind, dnsmasq, etc..) running on your PC, listening on 127.0.0.1 for hostname lookups.. That is exactly what Peter has set-up.

Is that the case?  The netstat tool should indicate whether there is a DNS server running on your PC and listening for local connections on udp/53.    It's not usual to run a local DNS server on a PC.  Maybe that is the standard configuration for Linux Mint, though?

You mention that you "restarted", and the Virgin nameservers were inserted in /etc/resolv.conf after that..    How did you perform that "restart"? What sort of restart was it?

Something is still retrieving the nameserver IP addresses from your Virgin router.  Thinking back to the bad old days of dialup, those nameserver identities can also be provided during the ppp handshake as well as by DHCP.  Two places to check..

cheers, a
Logged

Blackeagle

  • Reg Member
  • ***
  • Posts: 257
Re: DNS Servers
« Reply #17 on: May 02, 2012, 10:30:23 PM »

No idea how to do this in Linux, although Asbo and b*cat will both know, but if that was happening in Windows, I'd write a batch file to run at startup (after your /etc/resolv.conf is re-written) to re-write it with my wanted DNS server addresses.  I think peter alluded that this is what he does, to alter the order of them.

I know the order of running things at startup in a Win environment so I'd set it to run as the last thing, and then get the contents of the file, copy the first line to a temporary file, copy the next two lines to a  second temporary file, copy the next two lines to a 3rd temporary file, delete the original, then echo the first temp file to the new file, then the third and then the second.  This would re-write the file with the nameservers in the correct order for you.

There is probably some fancy 'grep' and piping combination that can do this in one line.

Your other option is to find the code that gets the nameservers from the router and disable it, so that just the openDNS servers are included.
Logged
ASCII stupid question, get a stupid ANSI -- TalkTalk Broadband since 2006

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: DNS Servers
« Reply #18 on: May 03, 2012, 01:44:22 AM »

Of course if it was a vanilla modem/router, as distinct to one molested/violated by the ISP, I would advise setting the modem/router to hand out the IP addresses of the DNS servers which were desired to be used. Then all systems on the LAN just need to use the modem/router's LAN address for the DNS server.  :-X
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #19 on: May 03, 2012, 08:46:03 AM »

Hang on... the first line suggests that there's a DNS server (bind, dnsmasq, etc..) running on your PC, listening on 127.0.0.1 for hostname lookups.. That is exactly what Peter has set-up.

Is that the case?  The netstat tool should indicate whether there is a DNS server running on your PC and listening for local connections on udp/53.    It's not usual to run a local DNS server on a PC.  Maybe that is the standard configuration for Linux Mint, though?

It may well be that I've set something up without knowing it as I've tried all manner of 'solutions' thus far!

You mention that you "restarted", and the Virgin nameservers were inserted in /etc/resolv.conf after that..    How did you perform that "restart"? What sort of restart was it?

A full shut-down and restart

Something is still retrieving the nameserver IP addresses from your Virgin router.  Thinking back to the bad old days of dialup, those nameserver identities can also be provided during the ppp handshake as well as by DHCP.  Two places to check..

Ok, but where?  In the computer or in the router?

cheers, a
[/quote]
Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #20 on: May 03, 2012, 09:04:34 AM »

Of course if it was a vanilla modem/router, as distinct to one molested/violated by the ISP, I would advise setting the modem/router to hand out the IP addresses of the DNS servers which were desired to be used. Then all systems on the LAN just need to use the modem/router's LAN address for the DNS server.  :-X

That's it in a nutshell!  Until recently I was with TalkTalk (shiver) and with their router it was a simple matter to change the DNS addresses, save and continue.  Virgin have arbitrarily decided to lock their router to their own DNS servers and deny user access to those settings. There is quite a row brewing over this as we speak.  I'm advised that, under normal circumstances, setting DNS in the computer's network config should override the router settings but for some reason, this is not the case.  I'm sure it is nothing more than my inexperience.  I feel a bit like a blind man groping about in a strange house, in the dark, with welding gloves on............... ;D
Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: DNS Servers
« Reply #21 on: May 03, 2012, 04:24:47 PM »

b*cat nods his head, with a sad expression on his face.  :(

Far too many ISPs / CPs assume that they know best . . . 'nough said.  :-X

As for "with TalkTalk (shiver)", Black Eagle, Asbokid and I are known users of that ISP / CP. As end-users with adequate knowledge of "what's what", we are content with what we are provided by TT:-\

It seems, to me, that you current issue is down to uncertainty with the Linux Mint distribution. Yes, the correct configuration of each system connected to your LAN can override the use of the modem/router as your local DNS server.
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: DNS Servers
« Reply #22 on: May 03, 2012, 05:18:03 PM »

Quote
Something is still retrieving the nameserver IP addresses from your Virgin router.  Thinking back to the bad old days of dialup, those nameserver identities can also be provided during the ppp handshake as well as by DHCP.  Two places to check..
Ok, but where?  In the computer or in the router?

On the computer. Software running on your computer is modifying the /etc/resolv.conf list of nameservers.

The order of the nameserver entries in that configuration file is important.  The first nameserver in the list is queried first for hostname resolution. If that query is unsuccessful, the next nameserver in the list is queried, and so on..

The first entry in your resolv.conf file is nameserver 127.0.0.1. That suggests a nameserver may be running on the PC itself.

The netstat tool will indicate if that is so..

Code: [Select]
$ sudo netstat -nlup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:68              0.0.0.0:*                           13422/dhclient 
udp        0      0 0.0.0.0:51413           0.0.0.0:*                           20322/transmission-
udp        0      0 0.0.0.0:631             0.0.0.0:*                           1516/cupsd     
udp        0      0 0.0.0.0:43682           0.0.0.0:*                           20322/transmission-

We can see that no DNS server is running on this machine..  If there had been a nameserver running, then a entry like this would be shown by netstat:

Code: [Select]
$ sudo netstat -nlup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:53              0.0.0.0:*                           12345/adnsserver 

What does this netstat command return on your machine:

Code: [Select]
$ sudo netstat -nlup

cheers, a
Logged

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #23 on: May 03, 2012, 10:17:20 PM »

Hi asbokid - the output is  -

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:53              0.0.0.0:*                           1172/dnsmasq   
udp        0      0 0.0.0.0:68              0.0.0.0:*                           9977/dhclient   
udp        0      0 0.0.0.0:41573           0.0.0.0:*                           874/avahi-daemon: r
udp        0      0 192.168.0.255:137       0.0.0.0:*                           1378/nmbd       
udp        0      0 192.168.0.2:137         0.0.0.0:*                           1378/nmbd       
udp        0      0 0.0.0.0:137             0.0.0.0:*                           1378/nmbd       
udp        0      0 192.168.0.255:138       0.0.0.0:*                           1378/nmbd       
udp        0      0 192.168.0.2:138         0.0.0.0:*                           1378/nmbd       
udp        0      0 0.0.0.0:138             0.0.0.0:*                           1378/nmbd       
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           874/avahi-daemon: r
udp6       0      0 :::53                   :::*                                1172/dnsmasq   
udp6       0      0 :::5353                 :::*                                874/avahi-daemon: r
udp6       0      0 :::35076                :::*                                874/avahi-daemon: r

I see from the first line that dnsmasq is listed.  I installed that as part of my feeble attempts to resolve this issue but truthfully, I've no idea what it does or whether I've configured it correctly!
Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #24 on: May 03, 2012, 10:22:54 PM »

b*cat

As for "with TalkTalk (shiver)", Black Eagle, Asbokid and I are known users of that ISP / CP. As end-users with adequate knowledge of "what's what", we are content with what we are provided by TT:-\

And very good too!  Unfortunately, my experience with TT was a little different.............. ::)

It seems, to me, that you current issue is down to uncertainty with the Linux Mint distribution. Yes, the correct configuration of each system connected to your LAN can override the use of the modem/router as your local DNS server.

I can only refer you to my previous statement....'I'm sure it is nothing more than my inexperience.  I feel a bit like a blind man etc etc........
Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: DNS Servers
« Reply #25 on: May 03, 2012, 11:18:30 PM »

Hi asbokid - the output is  -

Code: [Select]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:53              0.0.0.0:*                           1172/dnsmasq 
 

I see from the first line that dnsmasq is listed.  I installed that as part of my feeble attempts to resolve this issue but truthfully, I've no idea what it does or whether I've configured it correctly!

So name resolution is currently being handled by dnsmasq..  But dnsmasq simply caches the results of previous hostname queries, queries which it has proxied to Virgin's nameservers..

If you manually edit /etc/resolv.conf and place your chosen nameserver at the top of the list in that file, it should solve the problem at least temporarily.   Maybe you could test that first by re-visiting the opendns checking tool with your browser.

Unless you definitely want DNS caching, maybe remove dnsmasq too.

Code: [Select]
$ sudo apt-get remove dnsmasq

How are you starting and stopping networking? 

Are you using the NetworkManager applet on the taskbar, as discussed above?

When the NetworkManager was used to edit the connection settings to add those OpenDNS name server addresses, were those modifications made to the correct connection listed under "Wired" connections?

Maybe check again.

Right click the NetworkManager icon on the taskbar. Go down to "Edit Connections...". a pop-up window appears. Select "Wired" and the connection you want to edit. That connection is labelled "Wired connection 1" on this PC.  Then click Edit.

The applet has "Connect Automatically" checked as well as "Available to all users". and under "IPv4 Settings", the pull-down "Method" menu has the following list:

Code: [Select]
Automatic (DHCP)
Automatic (DHCP) addresses only   <----
Manual
Link-Local Only
Shared to other computers
Disabled

Select "Automatic (DHCP) Addresses Only" under IPv4 Settings. Maybe also check that there isn't a conflicting nameserver option configured under "IPv6 Settings".

Then enter the DNS servers you want:  e.g. 208.67.222.222, 208.67.222.220



Click 'Save' and 'Close' the NetworkManager applet window.

Now Left Click on the NetworkManager taskbar icon and left click 'Wired Network | Disconnect'.

From a shell type the following command and note that the output is the same as below.  It shows that no nameserver is configured (because the network is down).

Code: [Select]
$ cat /etc/resolv.conf
# Generated by NetworkManager

Now Left Click again on the NetworkManager applet.  Left click 'Wired connection 1' to bring the connection back up again. Wait until the DHCP server on the Virgin router has done its stuff (the spinny icon thingy on the taskbar has stopped spinning).

From a shell run the following command again and hopefully you should see this output.

Code: [Select]
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 208.67.222.222
nameserver 208.67.222.220

Again, check by visiting http://www.opendns.com/welcome/  that it is configured correctly..



cheers, a
« Last Edit: May 03, 2012, 11:53:23 PM by asbokid »
Logged

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #26 on: May 04, 2012, 09:50:26 PM »


Unless you definitely want DNS caching, maybe remove dnsmasq too.      Done

How are you starting and stopping networking?    Via network applet - left click, disconnect/reconnect as appropriate

When the Network Manager was used to edit the connection settings to add those OpenDNS name server addresses, were those modifications made to the correct connection listed under "Wired" connections?     Yes.  In fact I set up 'wired 1' and 'wired 2'.  I changed #2 to the opendns settings and #1 to the same as the router.  I did this as a precaution in case I messed up; this way I knew I'd still have internet access on one of them.  But here's the thing - I also tried leaving #2 blank, saved, disconned and reconned #2 but still connected ok!  Which suggests the applet is having no effect whatsoever?

Select "Automatic (DHCP) Addresses Only" under IPv4 Settings. Maybe also check that there isn't a conflicting nameserver option configured under "IPv6 Settings".  Done, and no IPv6 options.

Then enter the DNS servers you want:  e.g. 208.67.222.222, 208.67.222.220  Done

Click 'Save' and 'Close' the NetworkManager applet window.    Done

Now Left Click on the NetworkManager taskbar icon and left click 'Wired Network | Disconnect'.   Done - on #1 in this instance

From a shell type the following command and note that the output is the same as below.  It shows that no nameserver is configured (because the network is down).   
But I get this!   
# Generated by resolvconf
nameserver 194.168.4.100
nameserver 194.168.8.100


Now Left Click again on the NetworkManager applet.  Left click 'Wired connection 1' to bring the connection back up again. Wait until the DHCP server on the Virgin router has done its stuff (the spinny icon thingy on the taskbar has stopped spinning).   Done

From a shell run the following command again and hopefully you should see this output.
Code: [Select]
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 208.67.222.222
nameserver 208.67.222.220

And then this!
# Generated by resolvconf
nameserver 194.168.4.100
nameserver 194.168.8.100
nameserver 208.67.222.222
nameserver 208.67.220.220


I've also tried deleting 'wired 2' in case of a possible conflict but this has no effect.  Ditto DNS flush of the browser.  But, when I try to flush the DNS from the computer, I get this

/etc/rc.d/init.d/nscd restart
 
bash: /etc/rc.d/init.d/nscd: No such file or directory
sudo /etc/rc.d/init.d/nscd restart
[sudo] password for xxxxx:
sudo: /etc/rc.d/init.d/nscd: command not found


Is it possible that this might have a bearing?  and thanks again for the time and effort you are putting into this!

Rich

Edit:   I found how to install /etc/rc.d/init.d/nscd : ran it but still same!
Edit 2: I also spotted that, in your screenshot of 'iPv4 connections', the box for 'Require iPv4 addressing.............etc' is left unchecked.  Is this the case or an omission?

 
« Last Edit: May 05, 2012, 08:52:45 AM by Golfer »
Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: DNS Servers
« Reply #27 on: May 04, 2012, 10:38:37 PM »

I set up 'wired 1' and 'wired 2'.  I changed #2 to the opendns settings and #1 to the same as the router.  I did this as a precaution in case I messed up; this way I knew I'd still have internet access on one of them.  But here's the thing - I also tried leaving #2 blank, saved, disconned and reconned #2 but still connected ok!  Which suggests the applet is having no effect whatsoever?

Ahh. At a guess, maybe that's because "Wired 1" was configured to auto-reconnect, even though you selected the "Wired 2" connection.

Quote
But I get this!   
Code: [Select]
# Generated by resolvconf
nameserver 194.168.4.100
nameserver 194.168.8.100
...
And then this!
Code: [Select]
# Generated by resolvconf
nameserver 194.168.4.100
nameserver 194.168.8.100
nameserver 208.67.222.222
nameserver 208.67.220.220

Aha! There's the clue...

Your Linux Mint installation is using a nameserver manager called resolvconf in addition to the NetworkManager applet..

So there are two conflicting tools simultaneously configuring the same options!

I've never even heard of the tool called resolvconf but the manpage for it is here..

http://manpages.ubuntu.com/manpages/karmic/man8/resolvconf.8.html

It looks like you've got a few options to sort it out..

a) Disable resolvconf at boot time. See the update-rc.d and the chkconfig tools to do that; or
b) Uninstall resolvconf altogether (with sudo apt-get remove resolvconf); or
c) Edit the /etc/network/interfaces configuration file as per the info in that manpage for resolvconf

Maybe go for c).. since it's easily reversible..

Code: [Select]
$ gedit /etc/network/interfaces

And now add a # to the beginning of the line in /etc/networks/interfaces that reads..

Code: [Select]
dns-nameservers 194.168.4.100 194.168.8.100

So that it reads as follows (the # is a comment character that disables the commands on a line)

Code: [Select]
#dns-nameservers 194.168.4.100 194.168.8.100

EDIT:

If you find that the file /etc/networks/interfaces does not contain that reference to Virgin's nameservers, then you may have to look for those nameserver references in the other configuration files used by resolvconf.

According to the manpage for resolvconf those other files are:

/etc/resolvconf/resolv.conf.d/base and
/etc/resolvconf/resolv.conf.d/head

Stop and re-start the network interface by left clicking on 'Wired 1' under the NetworkManager icon..

Check again with:

Code: [Select]
$ cat /etc/resolv.conf


Hopefully that's it?!

cheers, a

Quote
Edit:   I found how to install /etc/rc.d/init.d/nscd : ran it but still same!

You might want to remove that also!
« Last Edit: May 04, 2012, 10:50:41 PM by asbokid »
Logged

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #28 on: May 05, 2012, 09:37:08 AM »

Hi asbokid - thanks for your patience!  This is now getting weird! 

"Your Linux Mint installation is using a nameserver manager called resolvconf in addition to the NetworkManager applet.. "

sudo apt-get remove resolvconf
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package resolvconf is not installed, so not removed  Er, what?
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.


gedit /etc/network/interfaces  Gives me
auto lo
iface lo inet loopback
  ?  Looking through the listed files for resolvconf gives me this -

#!/bin/sh
# ifdown hook script for resolvconf
# Written by Roy Marples <roy@marples.name> under the BSD-2 license

[ -x /sbin/resolvconf ] || exit 0
case "$ADDRFAM" in
   inet|inet6) : ;;
   *) exit 0;;
esac
[ "$METHOD" = dhcp ] && /sbin/resolvconf -f -d "$IFACE"
/sbin/resolvconf -f -d "$IFACE.$ADDRFAM"
  And then.....................

 /etc/resolvconf/resolv.conf.d/base
bash: /etc/resolvconf/resolv.conf.d/base: No such file or directory
   And......

cat /etc/resolv.conf
Generated by resolvconf
nameserver 194.168.4.100
nameserver 194.168.8.100
nameserver 208.67.222.222
nameserver 208.67.220.220
   !!!!!!!!!!!

These entries are listed as read only so, not only do they not exist, I can't edit them either.........

.........now looking for a darkened room to lie down in......... :'(











Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945

Golfer

  • Member
  • **
  • Posts: 55
  • This is how I THINK I look
Re: DNS Servers
« Reply #29 on: May 05, 2012, 11:49:23 AM »

Notwithstanding all of the above..............................and in frustration.................

I returned (again) to the VM Superhub settings page and tried (again) to reset the dns addresses using static rather than dynamic.  (I'd had several previous attempts with no success - even having 'access denied' to the internet).  However, this time it worked!  Dns addresses as entered and access to openDNS successful!   (Please don't ask me how or why, I won't be able to tell you!) :D

One (or two) more questions, if you can bear it ........................!! :no:

I understand the difference between static and dynamic addresses but will having a static address have any effect whatsoever on what I do on the 'net?  Can I keep that setting forever or will there come a time when it will need to change it?  Is internet security compromised in any way?

I can't thank all of you enough for your help - and there's a pint waiting on the bar at my local..................... ;)

Rich

Logged
If you can keep your head when all about you
Are losing theirs and blaming it on you,
Run like **************!
AH 1945
Pages: 1 [2] 3
 

anything