LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-06-2018, 10:35 AM   #16
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211

Quote:
Originally Posted by mr.travo View Post
scasey-

Thank you for the help. Sorry, but I am still learning all of this. It's kind of a crash course of networking and learning what everything does. All I am going off of is what I learn on YouTube and a few message boards like this one. I learn best by just getting in there and doing it

If I remember correctly, I didn't "install" openDNS. I believe I just pointed to their DNS servers. I know there are better terms I can be using, I am sorry for being so wet behind the ears with all of this. I appreciate you guys taking the time to help me out and help me understand what everything means and does. That's the important part to me. Any moron (like me) can type commands someone else is feeding him, but I want to learn what I am doing and why, it's the only way I will retain the information.


Again, thanks for the help!
My pleasure.
I just learned of OpenDNS in this thread. I don't see how that's useful to me, personally, but I can see that having that kind of filtering could be useful in home situations.
I did have to change my home DNS to Cox's unfiltered servers many moons ago. Their default servers do some filtering...I don't recall why or what. As I say, it was many moons ago.
On the production box, I resolve with the datacenter's resolving servers...any problems are a phone call away.
 
Old 03-06-2018, 12:09 PM   #17
mr.travo
Member
 
Registered: Oct 2017
Location: All over the US
Distribution: Mint 18.3 Cinnamon, Gallium, Ubuntu Armbian (headless), Arch (learning)
Posts: 138

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by MensaWater
Sorry typo. The command should be "lsof -i :53" but you figured tthat out. Since it returned nothing it means your local server is NOT LISTENing on that port meaning you're not running BIND even if you have it installed.

Your dig commands show you CAN reach the OpenDNS name servers.

I was suggesting you could edit /etc/resolv.conf to add the two OpenDNS servers. Since you're not LISTENing locally you could also remove the existing 127.x.x.x entry as that would be for local DNS port (53). However, I also suggested you type "man 8 resolvconf" to see what that man page has to say given that your existing resolv.conf says NOT to edit it.
Got ya (I think)-

We are trying to see how to 'safely' edit the resolv.conf. When we find out, I will comment out [or] delete the 127.0.2.1 entry and then add nameserver 208.67.222.222 & nameserver 208.67.220.220.

The 8 resolvconf-

Code:
DESCRIPTION
       The  resolvconf  package comprises a simple database for run-time name‐
       server information and a simple framework for notifying applications of
       changes  in  that  information.   Resolvconf thus sets itself up as the
       intermediary between programs that supply  nameserver  information  and
       applications that use that information.

       Information  is added to or removed from the database using the resolv‐
       conf program.  See the OPTIONS section below for a  discussion  of  the
       available options.

SUPPLIERS OF NAMESERVER INFORMATION
       Normally  the  resolvconf program is run only by network interface con‐
       figuration  programs  such  as  ifup(8),   ifdown,   NetworkManager(8),
       dhclient(8),  and pppd(8); and by local nameservers such as dnsmasq(8).
       These programs obtain nameserver information from some source and  push
       it to resolvconf.

   dhclient
       The dhclient program, for example, may receive nameserver addresses and
       domain search list information during its  negotiation  with  the  DHCP
       server; if so, its hook script /etc/dhcp/dhclient-enter-hooks.d/resolv‐
       conf pushes this information to resolvconf.

   ifup
       The ifup program can be used to configure network interfaces  according
       to  settings  in /etc/network/interfaces.  To make ifup push nameserver
       information to resolvconf when it configures an interface the  adminis‐
       trator  must  add  dns-  option  lines  to the relevant iface stanza in
       interfaces(5).  The following  option  names  are  accepted:  dns-name‐
       server, dns-search, and dns-sortlist.

To  add  a  nameserver  IP  address,  add  an option line consisting of
       dns-nameserver and the address.  To add multiple nameserver  addresses,
       include multiple such dns-nameserver lines.

           dns-nameserver 192.168.1.254
           dns-nameserver 8.8.8.8

       To add search domain names, add a line beginning with dns-search.

           dns-search foo.org bar.com

       The dns-nameservers option is also accepted and, unlike dns-nameserver,
       can be given multiple arguments, separated by spaces.

       The dns-domain option is deprecated in favor of dns-search.

       The resulting stanza might look like the following example.

           iface eth0 inet static
               address 192.168.1.3
               netmask 255.255.255.0
               gateway 192.168.1.1
               dns-nameserver 192.168.1.254
               dns-nameserver 8.8.8.8
               dns-search foo.org bar.com

       N.B.: On a machine where resolvconf has just been or  is  about  to  be
       installed  and  which  previously  relied  on a static /etc/resolv.conf
       file,

       ·      the nameserver information in that static file, (which is to say
              the  information  on  nameserver,  domain,  search  and sortlist
              lines) should be migrated to the appropriate iface stanza(s)  in
              /etc/network/interfaces(5) as just described;

       ·      options  (which is to say, any options lines) should be migrated
              to /etc/resolvconf/resolv.conf.d/base.

   Command line
       The administrator can run resolvconf from the command line  to  add  or
       delete  nameserver  information,  but this is not normally necessary or
       advisable.
The manual goes on, but this looked to be the important stuff regarding editing the conf file.... (I think).....

Last edited by mr.travo; 03-06-2018 at 12:12 PM.
 
Old 03-06-2018, 12:29 PM   #18
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by mr.travo View Post
Got ya (I think)-

We are trying to see how to 'safely' edit the resolv.conf. When we find out, I will comment out [or] delete the 127.0.2.1 entry and then add nameserver 208.67.222.222 & nameserver 208.67.220.220
On Mint, I do the following:

gksudo xed /etc/resolvconf/resolv.conf.d/head to add (ignore warning):

nameserver 208.67.222.222
nameserver 208.67.220.220

sudo resolvconf -u
 
Old 03-06-2018, 12:50 PM   #19
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The Linux I use doesn't have resolvconf command. Based on what you wrote it appears you could do "grep dns-nameserver /etc/network/interfaces" to see if it contains the 127.x.x.x line you see in /etc/resolv.conf. You could then replace that line with dns-nameserver lines for the 2 OpenDNS servers.

However, you can likely test your resolv.conf change directly before doing that:
cd /etc
cp -p resolv.conf resolv.conf.YYYYMMDD
vi resolv.conf (or your favorite editor - change the lines to add the two OpenDNS nameservers).

Do your "dig craigslist.com" from command line after the edit. Without specifying DNS server to use in dig it will use the ones specified in resolv.conf.

You can backout simply by copying the resolv.conf.YYYYMMDD back over resolv.conf so it reverts to original settings.

You'd need to update /etc/network/interfaces so it adds the same servers back to resolv.conf on restart of networking (e.g. after a reboot).
 
Old 03-06-2018, 03:13 PM   #20
mr.travo
Member
 
Registered: Oct 2017
Location: All over the US
Distribution: Mint 18.3 Cinnamon, Gallium, Ubuntu Armbian (headless), Arch (learning)
Posts: 138

Original Poster
Rep: Reputation: 10
Thank you both!

I ended up using

Quote:
Originally Posted by hydrurga
gksudo xed /etc/resolvconf/resolv.conf.d/head to add (ignore warning):

nameserver 208.67.222.222
nameserver 208.67.220.220

sudo resolvconf -u
When I tried
Quote:
Originally Posted by MensaWater
cd /etc
cp -p resolv.conf resolv.conf.YYYYMMDD
vi resolv.conf (or your favorite editor - change the lines to add the two OpenDNS nameservers).
It did not accept the changes when I restarted the network.

I do, however, still show the 127.0.2.1
Code:
mint18@mint18 ~ $ cat /etc/resolv.conf
# 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 208.67.222.222
nameserver 208.67.220.220
nameserver 127.0.2.1
When I dig craigslist.com
Code:
mint18@mint18 ~ $ dig craigslist.com

; <<>> DiG 9.10.3-P4-Ubuntu <<>> craigslist.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10618
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;craigslist.com.			IN	A

;; ANSWER SECTION:
craigslist.com.		0	IN	A	146.112.61.106

;; Query time: 43 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Tue Mar 06 16:02:03 EST 2018
;; MSG SIZE  rcvd: 59
And ***IF*** I understand the dig correctly, craigslist.com ip address is 146.112.61.106 and it made the connection to craigslist.com on DNS server 208.67.222.222 on port 53.

Hopefully I am starting to understand what is going on.

How do I remove the 127.0.2.1?

Thanks guys!
 
Old 03-06-2018, 03:24 PM   #21
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
When I tried
cd /etc
cp -p resolv.conf resolv.conf.YYYYMMDD
vi resolv.conf (or your favorite editor - change the lines to add the two OpenDNS nameservers).
It did not accept the changes when I restarted the network.
Right. I said it should work UNTIL you restarted networking:
Quote:
You'd need to update /etc/network/interfaces so it adds the same servers back to resolv.conf on restart of networking (e.g. after a reboot).
The idea was to do a test by doing direct edit without restarting networking.

Anyway you got it to work.

My guess as to why you still have the 127.x.x.x entry is that it is in file /etc/resolvconf/resolv.conf.d/head. You could probably edit that to remove it then rerun the resolvconf -u. You probably want to remove it as there is a delay between checking nameservers and it checks them in the order found in resolv.conf until it finds the answer.
 
Old 03-06-2018, 04:43 PM   #22
mr.travo
Member
 
Registered: Oct 2017
Location: All over the US
Distribution: Mint 18.3 Cinnamon, Gallium, Ubuntu Armbian (headless), Arch (learning)
Posts: 138

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by MensaWater View Post
Right. I said it should work UNTIL you restarted networking:


The idea was to do a test by doing direct edit without restarting networking.

Anyway you got it to work.

My guess as to why you still have the 127.x.x.x entry is that it is in file /etc/resolvconf/resolv.conf.d/head. You could probably edit that to remove it then rerun the resolvconf -u. You probably want to remove it as there is a delay between checking nameservers and it checks them in the order found in resolv.conf until it finds the answer.
Sorry about that! I must of glossed over the instructions as running that as a test.

As far as the 127.x.x.x goes, it is not in the head file. Only the two DNS addresses that we added are in it.
Code:
mint18@mint18 ~ $ cat /etc/resolvconf/resolv.conf.d/head
# 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 208.67.222.222
nameserver 208.67.220.220
 
Old 03-06-2018, 04:51 PM   #23
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by MensaWater View Post
My guess as to why you still have the 127.x.x.x entry is that it is in file /etc/resolvconf/resolv.conf.d/head. You could probably edit that to remove it then rerun the resolvconf -u. You probably want to remove it as there is a delay between checking nameservers and it checks them in the order found in resolv.conf until it finds the answer.
That's not how it works. Once a server has responded with something other than a server error, no further servers are queried. Note that NXDOMAIN (No such domain) is not an error in that context. That is the answer.
 
Old 03-06-2018, 06:23 PM   #24
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
You could try this to disable the local resolver (I've never done this):

https://askubuntu.com/questions/9072...lved-in-ubuntu
 
Old 03-06-2018, 06:42 PM   #25
mr.travo
Member
 
Registered: Oct 2017
Location: All over the US
Distribution: Mint 18.3 Cinnamon, Gallium, Ubuntu Armbian (headless), Arch (learning)
Posts: 138

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by hydrurga View Post
You could try this to disable the local resolver (I've never done this):

https://askubuntu.com/questions/9072...lved-in-ubuntu
Thank you for the link. I read over the posts and am thinking about it. What's the advantage of getting the 127.x.x.x out of there? I like having everything clean and clutter free, but is that all I am accomplishing?

Thanks for the help with all of this!
 
Old 03-06-2018, 07:01 PM   #26
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by mr.travo View Post
Thank you for the link. I read over the posts and am thinking about it. What's the advantage of getting the 127.x.x.x out of there? I like having everything clean and clutter free, but is that all I am accomplishing?

Thanks for the help with all of this!
No advantage as far as I personally can see. My approach is not to meddle until I really have to, and in this case there's no real need to meddle.
 
Old 03-06-2018, 10:33 PM   #27
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
If you don't have some local caching DNS server first in the list or have some other means of caching DNS responses (e.g., nscd), then every DNS query from an application has to go out on the network and be satisfied by the remote server. Using a local caching server, either bind in a "forward only" configuration or dnsmasq, cached lookups are satisfied locally, saving that overhead. When starting with Linux, one of the first things I noticed about network traffic was how many more DNS queries Linux was sending vs. a Windows system doing similar things. That got me to install a local caching server on Linux.
 
Old 03-07-2018, 01:54 AM   #28
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by elcore View Post
According to wikipedia page they used to inject ads, but not anymore.
i see. well it's still a commercial entity and moving to opendns from your ISP's dns servers, could well turn out to be a case of "from the frying pan into the fire".
as opposed to opennic, which is a truly community-driven project.

mr.travo, i am confused how a simple problem as craigslist being blocked turned out to accumulate so many posts and such complex-looking & fragile solution attempts.
i have the feeling someone is trying to reinvent the wheel here.
i strongly suggest searching for existing solutions, and applying them, instead of re-inventing the aquisition of DNS servers.
if you would consider opennic, i can offer 2 github repos, of which at least one is likely to meet your requirements: https://github.com/mar77i/opennic, https://github.com/kewlfft/opennic-up

- but you should really take a look what your distro's repositories, website, wiki, askubuntu etc. have to offer.
 
Old 03-07-2018, 07:21 AM   #29
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by rknichols View Post
That's not how it works. Once a server has responded with something other than a server error, no further servers are queried. Note that NXDOMAIN (No such domain) is not an error in that context. That is the answer.
It IS how it works. If one nameserver can't be queried (as is the case with his 127.x.x.x nameserver) it moves on to the next one. A nameserver being unreachable is not the same as an NXDOMAIN response from a nameserver. If it didn't work this way there would never be a point in adding more than one nameserver to resolv.conf.

The advantage of removing a non-functioning nameserver is to eliminate the time it takes to try querying that server then move on to the next. Some things are sensitive to the timeout (e.g. Oracle products). We once had issues and even adjusting the timeout in resolv.conf didn't make it fast enough.

Last edited by MensaWater; 03-07-2018 at 07:24 AM.
 
Old 03-07-2018, 09:20 AM   #30
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by MensaWater View Post
It IS how it works. If one nameserver can't be queried (as is the case with his 127.x.x.x nameserver) it moves on to the next one. A nameserver being unreachable is not the same as an NXDOMAIN response from a nameserver. If it didn't work this way there would never be a point in adding more than one nameserver to resolv.conf.
Sorry, I misinterpreted what you meant by, "checks them in the order found in resolv.conf until it finds the answer." So many people think that it means, "until it finds one that can resolve the name."
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using xxxterm to browse common websites such as google and craigslist julianvb Linux - Software 3 07-06-2014 07:27 PM
LXer: Open Recall: Doppio, CraigsList and OSM, Red Hat crop circles, Portable Apps LXer Syndicated Linux News 0 10-08-2012 06:40 PM
LXer: Is Craigslist using Ubuntu? Is this picture proof? LXer Syndicated Linux News 0 02-27-2010 02:51 AM
Craigslist searching? mma8x Linux - General 3 12-03-2008 07:10 AM
OpenDNS adriv Slackware 7 05-05-2007 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration