Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to ask if the nameservers in /etc/resolv.conf are working like:
Check first one and if not working it goes to the second one and then the third one?
See 'man resolv.conf'.
Quote:
Originally Posted by ASTRAPI
Also after do that changes is a /etc/init.d/network restart enough to start using the new one on top of the file?
Yes.
Quote:
Originally Posted by ASTRAPI
Do i have to flush any dns cache and how?
Check if you run nscd or caching name server service and restart it.
Quote:
Originally Posted by ASTRAPI
And last question how can i verify which one my Centos 6.6 server is using after the changes?
By default 'dig' will display a statistics section, see the ";; SERVER: " section at the bottom of the answer.
yum clean all
[root@server ~]# yum update
Loaded plugins: downloadonly, fastestmirror, priorities
Setting up Update Process
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base
;; ANSWER SECTION:
google.com. 218 IN AAAA 2404:6800:4005:801::1007
google.com. 127 IN A 173.194.127.46
google.com. 127 IN A 173.194.127.32
google.com. 127 IN A 173.194.127.33
google.com. 127 IN A 173.194.127.34
google.com. 127 IN A 173.194.127.35
google.com. 127 IN A 173.194.127.36
google.com. 127 IN A 173.194.127.37
google.com. 127 IN A 173.194.127.38
google.com. 127 IN A 173.194.127.39
google.com. 127 IN A 173.194.127.40
google.com. 127 IN A 173.194.127.41
google.com. 30929 IN NS ns2.google.com.
google.com. 30929 IN NS ns4.google.com.
google.com. 30929 IN NS ns3.google.com.
google.com. 30929 IN NS ns1.google.com.
;; AUTHORITY SECTION:
google.com. 30929 IN NS ns4.google.com.
google.com. 30929 IN NS ns2.google.com.
google.com. 30929 IN NS ns3.google.com.
google.com. 30929 IN NS ns1.google.com.
;; ADDITIONAL SECTION:
ns1.google.com. 203927 IN A 216.239.32.10
ns2.google.com. 204645 IN A 216.239.34.10
ns3.google.com. 204282 IN A 216.239.36.10
ns4.google.com. 205854 IN A 216.239.38.10
;; Query time: 350 msec
;; SERVER: 164.124.101.88#53(164.124.101.88)
;; WHEN: Sun Dec 28 02:50:00 2014
;; MSG SIZE rcvd: 424
+ dig -t any google.com @211.238.186.4
;; Truncated, retrying in TCP mode.
;; ANSWER SECTION:
google.com. 86400 IN TYPE257 \# 19 0005697373756573796D616E7465632E636F6D
google.com. 3600 IN TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
google.com. 86400 IN SOA ns1.google.com. dns-admin.google.com. 2014112500 7200 1800 1209600 300
google.com. 600 IN MX 50 alt4.aspmx.l.google.com.
google.com. 600 IN MX 10 aspmx.l.google.com.
google.com. 600 IN MX 20 alt1.aspmx.l.google.com.
google.com. 600 IN MX 30 alt2.aspmx.l.google.com.
google.com. 600 IN MX 40 alt3.aspmx.l.google.com.
google.com. 300 IN AAAA 2404:6800:4004:808::1008
google.com. 300 IN A 173.194.126.194
google.com. 300 IN A 173.194.126.195
google.com. 300 IN A 173.194.126.196
google.com. 300 IN A 173.194.126.197
google.com. 300 IN A 173.194.126.198
google.com. 300 IN A 173.194.126.199
google.com. 300 IN A 173.194.126.200
google.com. 300 IN A 173.194.126.201
google.com. 300 IN A 173.194.126.206
google.com. 300 IN A 173.194.126.192
google.com. 300 IN A 173.194.126.193
google.com. 345600 IN NS ns4.google.com.
google.com. 345600 IN NS ns1.google.com.
google.com. 345600 IN NS ns2.google.com.
google.com. 345600 IN NS ns3.google.com.
;; AUTHORITY SECTION:
google.com. 345600 IN NS ns3.google.com.
google.com. 345600 IN NS ns4.google.com.
google.com. 345600 IN NS ns1.google.com.
google.com. 345600 IN NS ns2.google.com.
;; ADDITIONAL SECTION:
ns1.google.com. 315535 IN A 216.239.32.10
ns2.google.com. 315535 IN A 216.239.34.10
ns3.google.com. 315535 IN A 216.239.36.10
ns4.google.com. 315535 IN A 216.239.38.10
;; Query time: 294 msec
;; SERVER: 211.238.186.4#53(211.238.186.4)
;; WHEN: Sun Dec 28 02:50:00 2014
;; MSG SIZE rcvd: 697
+ dig -t any google.com @8.8.8.8
;; Truncated, retrying in TCP mode.
;; ANSWER SECTION:
google.com. 299 IN A 173.194.40.133
google.com. 299 IN A 173.194.40.136
google.com. 299 IN A 173.194.40.137
google.com. 299 IN A 173.194.40.131
google.com. 299 IN A 173.194.40.142
google.com. 299 IN A 173.194.40.135
google.com. 299 IN A 173.194.40.129
google.com. 299 IN A 173.194.40.132
google.com. 299 IN A 173.194.40.134
google.com. 299 IN A 173.194.40.128
google.com. 299 IN A 173.194.40.130
google.com. 299 IN AAAA 2a00:1450:4007:808::1000
google.com. 21599 IN SOA ns1.google.com. dns-admin.google.com. 2014112500 7200 1800 1209600 300
google.com. 599 IN MX 40 alt3.aspmx.l.google.com.
google.com. 21599 IN NS ns4.google.com.
google.com. 21599 IN NS ns2.google.com.
google.com. 599 IN MX 30 alt2.aspmx.l.google.com.
google.com. 599 IN MX 10 aspmx.l.google.com.
google.com. 21599 IN TYPE257 \# 19 0005697373756573796D616E7465632E636F6D
google.com. 21599 IN NS ns1.google.com.
google.com. 599 IN MX 50 alt4.aspmx.l.google.com.
google.com. 599 IN MX 20 alt1.aspmx.l.google.com.
google.com. 3599 IN TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
google.com. 21599 IN NS ns3.google.com.
;; Query time: 14 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Dec 28 02:50:01 2014
;; MSG SIZE rcvd: 577
+ dig -t any google.com @8.8.4.4
;; Truncated, retrying in TCP mode.
;; ANSWER SECTION:
google.com. 299 IN A 173.194.40.133
google.com. 299 IN A 173.194.40.136
google.com. 299 IN A 173.194.40.137
google.com. 299 IN A 173.194.40.131
google.com. 299 IN A 173.194.40.142
google.com. 299 IN A 173.194.40.135
google.com. 299 IN A 173.194.40.129
google.com. 299 IN A 173.194.40.132
google.com. 299 IN A 173.194.40.134
google.com. 299 IN A 173.194.40.128
google.com. 299 IN A 173.194.40.130
google.com. 299 IN AAAA 2a00:1450:4007:808::1000
google.com. 21599 IN SOA ns1.google.com. dns-admin.google.com. 2014112500 7200 1800 1209600 300
google.com. 599 IN MX 40 alt3.aspmx.l.google.com.
google.com. 21599 IN NS ns4.google.com.
google.com. 21599 IN NS ns2.google.com.
google.com. 599 IN MX 30 alt2.aspmx.l.google.com.
google.com. 599 IN MX 10 aspmx.l.google.com.
google.com. 21599 IN TYPE257 \# 19 0005697373756573796D616E7465632E636F6D
google.com. 21599 IN NS ns1.google.com.
google.com. 599 IN MX 50 alt4.aspmx.l.google.com.
google.com. 599 IN MX 20 alt1.aspmx.l.google.com.
google.com. 3599 IN TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
google.com. 21599 IN NS ns3.google.com.
;; Query time: 12 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Sun Dec 28 02:50:01 2014
;; MSG SIZE rcvd: 577
+ dig -t any google.com @208.67.222.222
;; Truncated, retrying in TCP mode.
;; ANSWER SECTION:
google.com. 290 IN A 173.194.40.133
google.com. 290 IN A 173.194.40.137
google.com. 290 IN A 173.194.40.129
google.com. 290 IN A 173.194.40.128
google.com. 290 IN A 173.194.40.132
google.com. 290 IN A 173.194.40.134
google.com. 290 IN A 173.194.40.131
google.com. 290 IN A 173.194.40.130
google.com. 290 IN A 173.194.40.142
google.com. 290 IN A 173.194.40.136
google.com. 290 IN A 173.194.40.135
google.com. 290 IN AAAA 2a00:1450:4007:808::1008
google.com. 590 IN MX 10 aspmx.l.google.com.
google.com. 590 IN MX 50 alt4.aspmx.l.google.com.
google.com. 590 IN MX 30 alt2.aspmx.l.google.com.
google.com. 590 IN MX 40 alt3.aspmx.l.google.com.
google.com. 590 IN MX 20 alt1.aspmx.l.google.com.
google.com. 345590 IN NS ns2.google.com.
google.com. 345590 IN NS ns1.google.com.
google.com. 345590 IN NS ns3.google.com.
google.com. 345590 IN NS ns4.google.com.
google.com. 86390 IN SOA ns1.google.com. dns-admin.google.com. 2014112500 7200 1800 1209600 300
google.com. 3590 IN TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
;; Query time: 6 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Sun Dec 28 02:50:11 2014
;; MSG SIZE rcvd: 546
+ dig -t any google.com @208.67.220.220
;; Truncated, retrying in TCP mode.
;; ANSWER SECTION:
google.com. 290 IN A 173.194.40.133
google.com. 290 IN A 173.194.40.137
google.com. 290 IN A 173.194.40.129
google.com. 290 IN A 173.194.40.128
google.com. 290 IN A 173.194.40.132
google.com. 290 IN A 173.194.40.134
google.com. 290 IN A 173.194.40.131
google.com. 290 IN A 173.194.40.130
google.com. 290 IN A 173.194.40.142
google.com. 290 IN A 173.194.40.136
google.com. 290 IN A 173.194.40.135
google.com. 290 IN AAAA 2a00:1450:4007:808::1008
google.com. 590 IN MX 10 aspmx.l.google.com.
google.com. 590 IN MX 50 alt4.aspmx.l.google.com.
google.com. 590 IN MX 30 alt2.aspmx.l.google.com.
google.com. 590 IN MX 40 alt3.aspmx.l.google.com.
google.com. 590 IN MX 20 alt1.aspmx.l.google.com.
google.com. 345590 IN NS ns2.google.com.
google.com. 345590 IN NS ns1.google.com.
google.com. 345590 IN NS ns3.google.com.
google.com. 345590 IN NS ns4.google.com.
google.com. 86390 IN SOA ns1.google.com. dns-admin.google.com. 2014112500 7200 1800 1209600 300
google.com. 3590 IN TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
;; Query time: 5 msec
;; SERVER: 208.67.220.220#53(208.67.220.220)
;; WHEN: Sun Dec 28 02:50:11 2014
;; MSG SIZE rcvd: 546
;; ANSWER SECTION:
google.com. 289 IN A 173.194.40.133
google.com. 289 IN A 173.194.40.136
google.com. 289 IN A 173.194.40.137
google.com. 289 IN A 173.194.40.131
google.com. 289 IN A 173.194.40.142
google.com. 289 IN A 173.194.40.135
google.com. 289 IN A 173.194.40.129
google.com. 289 IN A 173.194.40.132
google.com. 289 IN A 173.194.40.134
google.com. 289 IN A 173.194.40.128
google.com. 289 IN A 173.194.40.130
google.com. 289 IN AAAA 2a00:1450:4007:808::1000
google.com. 21589 IN SOA ns1.google.com. dns-admin.google.com. 2014112500 7200 1800 1209600 300
google.com. 589 IN MX 40 alt3.aspmx.l.google.com.
google.com. 21589 IN NS ns4.google.com.
google.com. 21589 IN NS ns2.google.com.
google.com. 589 IN MX 30 alt2.aspmx.l.google.com.
google.com. 589 IN MX 10 aspmx.l.google.com.
google.com. 21589 IN TYPE257 \# 19 0005697373756573796D616E7465632E636F6D
google.com. 21589 IN NS ns1.google.com.
google.com. 589 IN MX 50 alt4.aspmx.l.google.com.
google.com. 589 IN MX 20 alt1.aspmx.l.google.com.
google.com. 3589 IN TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
google.com. 21589 IN NS ns3.google.com.
;; Query time: 6 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Dec 28 02:50:11 2014
;; MSG SIZE rcvd: 577
So it does work (BTW: 4 out of 6 Domain Name Servers I know but 164.124.101.88 and 211.238.186.4 are korean ones and I see no particular reason why you should use those, especially not as 1st and 2nd entries.) and you can try the same query for "mirrorlist.centos.org" instead of "google.com". *BTW[1]: also check your DNS settings in your /stc/sysconfig/network-scripts/ifcfg-* files.
It seems to work but it doesn't as if i use the Google ones or from OpenDNS or from Level3 are not working.....
I can ping them but if i do a simple wget i got can't resolve problem And i have the same problem also with the yum update...
If i change them to the 164.124.101.88 all working great but is not fast as 5ms as the others, i am getting about 280ms
No idea why
My network card settings:
DEVICE="eth0"
BOOTPROTO="static"
DNS1="8.8.8.8" <---If i am not wrong this one is not active as i have disabled the NM_CONTROLLED="no"
GATEWAY="37.187.xxx.xxx"
HWADDR="0C:C4:7A:02:CAE"
IPADDR="37.187.xxx.xxx"
NETMASK="255.255.255.0"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="cb7ea12f-2ab7-45a1-896f-8ff948d7061c"
(..) if i do a simple wget i got can't resolve problem (..) If i change them to the 164.124.101.88 all working great
37.187.0.0 is OVH France so I see no technical reason why a korean DNS server would be faster.
For now concentrate on using DNS servers that work and not look for the fastest one.
Post output of the "awk" routine but change "google.com" to "mirrorlist.centos.org".
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 300 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
mirrorlist.centos.org. 300 IN A 72.232.223.58
mirrorlist.centos.org. 300 IN A 204.15.73.243
mirrorlist.centos.org. 300 IN A 64.235.47.134
;; AUTHORITY SECTION:
centos.org. 10322 IN NS ns3.centos.org.
centos.org. 10322 IN NS ns1.centos.org.
centos.org. 10322 IN NS ns4.centos.org.
;; ADDITIONAL SECTION:
ns1.centos.org. 53084 IN A 199.187.126.93
ns3.centos.org. 53084 IN A 88.208.217.170
ns4.centos.org. 291 IN A 62.141.54.220
;; Query time: 596 msec
;; SERVER: 164.124.101.88#53(164.124.101.88)
;; WHEN: Sun Dec 28 15:06:36 2014
;; MSG SIZE rcvd: 217
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 300 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
mirrorlist.centos.org. 300 IN A 64.235.47.134
mirrorlist.centos.org. 300 IN A 72.232.223.58
mirrorlist.centos.org. 300 IN A 204.15.73.243
;; AUTHORITY SECTION:
centos.org. 14400 IN NS ns4.centos.org.
centos.org. 14400 IN NS ns1.centos.org.
centos.org. 14400 IN NS ns3.centos.org.
;; Query time: 819 msec
;; SERVER: 211.238.186.4#53(211.238.186.4)
;; WHEN: Sun Dec 28 15:06:47 2014
;; MSG SIZE rcvd: 169
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 299 IN A 64.235.47.134
mirrorlist.centos.org. 299 IN A 204.15.73.243
mirrorlist.centos.org. 299 IN A 72.232.223.58
mirrorlist.centos.org. 299 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
;; Query time: 90 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Dec 28 15:06:47 2014
;; MSG SIZE rcvd: 115
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 299 IN A 72.232.223.58
mirrorlist.centos.org. 299 IN A 64.235.47.134
mirrorlist.centos.org. 299 IN A 204.15.73.243
mirrorlist.centos.org. 299 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
;; Query time: 90 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Sun Dec 28 15:06:47 2014
;; MSG SIZE rcvd: 115
+ dig -t any mirrorlist.centos.org @208.67.222.222
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 159 IN A 204.15.73.243
mirrorlist.centos.org. 159 IN A 64.235.47.134
mirrorlist.centos.org. 159 IN A 72.232.223.58
mirrorlist.centos.org. 23 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
;; Query time: 5 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Sun Dec 28 15:06:47 2014
;; MSG SIZE rcvd: 115
+ dig -t any mirrorlist.centos.org @208.67.220.220
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 159 IN A 204.15.73.243
mirrorlist.centos.org. 159 IN A 64.235.47.134
mirrorlist.centos.org. 159 IN A 72.232.223.58
mirrorlist.centos.org. 23 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
;; Query time: 5 msec
;; SERVER: 208.67.220.220#53(208.67.220.220)
;; WHEN: Sun Dec 28 15:06:47 2014
;; MSG SIZE rcvd: 115
;; QUESTION SECTION:
;mirrorlist.centos.org. IN ANY
;; ANSWER SECTION:
mirrorlist.centos.org. 299 IN A 72.232.223.58
mirrorlist.centos.org. 299 IN A 64.235.47.134
mirrorlist.centos.org. 299 IN A 204.15.73.243
mirrorlist.centos.org. 299 IN AAAA 2a02:2498:1:3d:5054:ff:fed3:e91a
;; Query time: 11 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Dec 28 15:06:47 2014
;; MSG SIZE rcvd: 115
Please edit your /etc/resolv.conf and use only (and in this order) these name servers: 8.8.8.8, 8.8.4.4, 208.67.220.220, 208.67.222.222.
Remove or comment out any other name servers. Temporarily (until we find the solution) add the IP addresses 72.232.223.58, 204.15.73.243, 64.235.47.134 to your /etc/hosts for "mirrorlist.centos.org".
Quote:
Originally Posted by ASTRAPI
Maybe a cache or csf/iptables problem?
Restart the "nscd" service or any caching name server service if you run them.
Now try to run 'yum check-update'.
Also please post output of
It is your server so you should know if you run say nscd or a caching name server (or not). If you are unsure what services are running run 'netstat -antulpe' or 'chkconfig --list|grep "$(runlevel|awk '{print $2}')n";'. (You do not have to show me the output.)
Quote:
Originally Posted by ASTRAPI
Running iptables-save doesn't return anything.
Then you do not have a firewall loaded. That is not a good practice.
Quote:
Originally Posted by ASTRAPI
Code:
yum clean all
(..)
Trying other mirror.
updates | 3.4 kB 00:00
updates/primary_db | 1.5 MB 00:00
1631 packages excluded due to repository priority protections
No Packages marked for Update
Good you did a 'yum clean all'.
So eventually it does load the updates. And the fact it reads "No Packages marked for Update" is due to repository protection: it does not mean there are no updates or that it was not able to fetch them.
So now back to the initial problem: did this problem occur always or did it start at some time? If the latter, can you trace back what changes were made?
I don't use a caching name server and the no output is maybe related that i stop csf when the problem happen so just to be sure taht is not block anything related....
Well all was running fine and 4 days ago i run yum update to the server and i update a few new files and i got a new kernel also but i was not reboot to activate it....
So after that a few hours ago i try to use wget to get a file from github....
I got an error that can't resolve github and then i test the same wget on another server from the same datacenter and all was fine....
Then i try to run yum update again and i got the same errors as above and a few users start to complain about not getting emails from postfix when they register to my forum
Then i try to ping : ping yahoo.com and i got can't resolve host so i think something is wrong with the nameserver 8.8.8.8 that i was use....
Changing this to 8.8.4.4 doesn't help as i got the same results.
I thought that this can happen if it can't use ipv4 and try to connect using ipv6...
So i remove this lines and try with open dns and level3 but nothing then i got the korean dns and all working now but i am getting 290ms instead of 5ms from google.....
That's all
It seems a global problem and not related to yum or wget or postfix as changing nameservers to Korean ones all are fine....
Really thanks for your help.... !
The one who fix this for me and give me this korean dns told me:
Quote:
Your have networking problem outside from server (hosting and upper)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.