LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   not able to update nameserver (https://www.linuxquestions.org/questions/linux-newbie-8/not-able-to-update-nameserver-908703/)

SarahGurung 10-18-2011 01:08 AM

not able to update nameserver
 
hello everyone,

when i tried to update my nameserver today,i got an error sayin:

cannot retrieve the mirrorlist http://mirrorlist.centos.org,urlopen...#39;connection timed out')

So what does this mean and what should i be doing now?

aazkan 10-18-2011 01:24 AM

Hi,

Couple of things to try, top of my head:

1. Is your /etc/resolv.conf pointed to your own nameserver? Perhaps point it out to Google's dns or opendns and try yum again.

2. Try using links or copy paste the url to your browser (IE,Chrome etc). To use links, access the url like so

links http://mirrolist.centos.org

if it returns a 404, CentOS mirrors could be unreachable at this time (maintenance, network latency etc)

3. If the URL is reachable, try the following on the machine your ran yum

yum clean all
yum check-update

SarahGurung 10-18-2011 01:31 AM

well i opened that url http://mirrorlist.centos.org as you said but it didnt return any error and opened easily and ya i did yum clean all and then yum check-update after that but i still got the same thing...

aazkan 10-18-2011 01:35 AM

I've come across this before but am not sure if how i solved it will work out for you but if you dont mind trying, I'll help out.

For starters, can you copy paste the actual error message you get when running yum?

also if you dont mind

lsb_release -a
uname -rmi

SarahGurung 10-18-2011 01:45 AM

well this is the exact error that i get when i run yum check-update command:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...86&repo=addons error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot find a valid baseurl for repo: addons

and when i did uname -rmi,it gave:
2.6.18-238.19.1.el5.centos.plusPAE i686 i386

and with lsb_release -a.it gave:
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.6 (Final)
Release: 5.6
Codename: Final

thanks...

aazkan 10-18-2011 01:59 AM

Can you try

yum --disableplugin=fastestmirror check-update -d6

Also, if you don't mind can you copy paste your /etc/resolv.conf?

aazkan 10-18-2011 02:01 AM

Oh yes, just crossed my mind, is there a http proxy up front of that CentOS box? If there is you'd probably want to set yum to use it or export the http_proxy variable.

SarahGurung 10-18-2011 03:10 AM

well can you please tell me what is the use of "yum --disableplugin=fastestmirror check-update -d6" command?because i have totry it on a live server and cant use it unless i'm very sure about what the command really does....please don't mind...

and i didnt understand what you meant by http proxy and all that...can you please elaborate on that?

Thank you..

aazkan 10-18-2011 03:30 AM

--disableplugin=fastestmirror

tells yum not to use the fastestmirror plugin

check-update

tells yum check update

-d6

tells yum to run with debug or more verbose

Sarah, if you're not comfortable then don't run any of the commands i've input. No harm to be paranoid.



In my LANs, no servers can access ftp, http and other ports directly (to prevent shell users or if the server is compromised) to download anything. The traffic going out is purposely not NATed or Masqueraded out.

So to allow something like yum which needs to access http, i need to export a http_proxy variable to yum so it knows to use a squid http proxy somewhere in my LANs.

If you're not using a http proxy then it's safe to ignore the suggestion as well. I'm betting it has to do with a http proxy or perhaps on the isp side.

SarahGurung 10-18-2011 03:57 AM

ell my boss isn't here and cant contact him either....i think he has used http proxy as he is really concerned with the securities,if so how should i be exporting the http variable or is there a way to know if http proxy is being used??

and you also told about the isp side?what could be wrong in the isp side?

deep27ak 10-18-2011 04:19 AM

Is your yum configured properly on the system?

are you able to install any other package using yum

please check with any package

and

also lookout for

Quote:

#vi /etc/resolv.conf
(post the output)

SarahGurung 10-18-2011 04:25 AM

yes,i am able to install other things using yum...

aazkan 10-18-2011 04:30 AM

if there is a http proxy that needs to be use, before running yum do this

export http_proxy=http://x.x.x.x:1234/; export ftp_proxy=http://x.x.x.x:1234/


when you're done do

unset http_proxy; unset ftp_proxy

i'm assuming you're using bash


About the isp, in one of our co-los, the isp puts a transparent http proxy, was a cisco webcache or something. The cache was dirty or stale. Once we get them to remove us (routing) from the being http cached transparently, yum worked nicely since.

deep27ak 10-18-2011 05:55 AM

if you are using any proxy server then

do the following

Code:

#vi /etc/yum.conf
in the [main] section at the bottom write
http_proxy=http://(your_proxy_address):(port no.)
export http_proxy=http://your_proxy_address:(port)


then go to
Code:

#vi /root/.bash_profile
(add this in the last line)
export http_proxy=http://your_proxy_address:(port)

thats it
now try using yum

SarahGurung 10-18-2011 06:12 AM

well previously we were using proxy server which was untangle but now we have removed that one...


so what could be the other possible reasons for not being able to use "yum check-update" command in our primary name server(ns0)??

SarahGurung 10-18-2011 10:19 PM

can anyone tell me please...

aazkan 10-18-2011 10:52 PM

Sarah,

Could you tell me if nslookup works on server with the broken yum?

Try with

nslookup mirror.centos.org ipofyournameserver

if it replies.

I saw another post by you about the webserver reolving to 127.0.0.1 and am guessing if fault dns could have been the cause.
On the same token, what's the content of /etc/resolv.conf on that server with the faulty yum?

You also mentioned your boss uses a http proxy. Any chance you try setting yum to use the http proxy?

Almost running out of ideas, i would suggest you reinstall yum i.e: download the yum rpm to the server or extract it from a centOS dvd, rpm remove yum and then rpm install it back again.

deep27ak 10-18-2011 10:55 PM

In that case can you post your

Code:

#vi yum.conf

#vi /etc/yum.repos.d/xxx.repo


SarahGurung 10-18-2011 11:03 PM

well the output of /ect/resolv.conf for the server with faulty yum is:
search tashicell.com

nameserver 118.103.137.1
nameserver 118.103.136.65
nameserver 118.103.136.67


and the output of yum.conf is:
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://b
ugs.centos.org/bug_report_page.php?category=yum

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

installonly_limit = 5

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

and the output for /etc/yum/repos.d/Centos-Base.repo is:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
priority=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
priority=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
priority=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
priority=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
priority=2
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo
=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=1
priority=2
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

SarahGurung 10-18-2011 11:28 PM

Aazkan this is th error that i get when i do "yum check-update":

Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...86&repo=addons error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot find a valid baseurl for repo: addons

aazkan 10-18-2011 11:48 PM

Your yum.conf and repos looks ok, nothing obviously wrong.

How comfortable are you with command lines to remove, download and install yum?
If you think your willing to have a go, i'll see to guiding you through.

I cant gurantee this will fix the problem but we'll at least be certain yum after reinstall will theoratically working out of the box.

I'll be out to fetch my son from his play school and out to be back online in an hour or so. Let me know if you want to give this a shot.

SarahGurung 10-18-2011 11:53 PM

wow thanks aazkan,that is really nice of you..

ya i would like to try this out but want you guiding me throughout as well...

Or is something wrong with my base url of the addons,because the error says that the "Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...86&repo=addons " ,and i went to this url it returns 404 error..

deep27ak 10-19-2011 12:08 AM

I think all you need to do is turn

Code:

enabled=0
in all the sections and try

SarahGurung 10-19-2011 12:17 AM

well in the other servers i.e the slave servers,enabled has been set to 1,yum check-update is still working...

it's only the primary nameserver which is having this problem..

deep27ak 10-19-2011 12:24 AM

there's no harm in trying:)

and if it doesn't works then it goes again to resolv.conf

SarahGurung 10-19-2011 12:45 AM

thanks deepak but i don't know what is wrong with my vi editor, m not able to save the changes...

i went to insert mode and made the changes and typed :wq to save the changes and exit but it isnt happening..am i wrong?

deep27ak 10-19-2011 12:53 AM

what is the error you are getting?

check the permissions on file

take a backup of the .repo file at some place and then change the permission as root user, then give it a try

SarahGurung 10-19-2011 01:37 AM

well deepak i did as u said...vi worked,it was my mistake that it didnt work that time....


even after putting 0 to enabled that command didnt work..

deep27ak 10-19-2011 02:08 AM

did you tried this command

Code:

#yum clean all
#yum update


are you able to list all yum?

Code:

#yum list

SarahGurung 10-19-2011 03:06 AM

ya i tried the first two commands,it gives the same problem still..

and yum list command is also not working,it gives the same error..

SarahGurung 10-19-2011 03:33 AM

aazkan are u back?and Mr.deepak can u help further from this?

deep27ak 10-19-2011 03:38 AM

@reply
Code:

# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.


why don't you try the base url for yum?

SarahGurung 10-19-2011 03:44 AM

i didnt't get you properly...

if what you meant was to tryin accesing the base url then,that isnt opening either..

deep27ak 10-19-2011 03:46 AM

Quote:

Originally Posted by SarahGurung (Post 4502210)
i didnt't get you properly...

if what you meant was to tryin accesing the base url then,that isnt opening either..


I mean comment the mirror list in the repo file
and uncomment all the baseurls

SarahGurung 10-19-2011 03:50 AM

by commenting u meant to put # in the front right?or is it different?

hen770 10-19-2011 03:51 AM

I have a problematic ISP, and with the same error what i have did is to comment the mirrorlist line and uncomment the baseurl line.
For me it has work.

deep27ak 10-19-2011 03:52 AM

yes just put # infront of mirror list and remove # from baseurl

this will work if the baseurl exist..!!!

SarahGurung 10-19-2011 03:59 AM

but when i copied that base url and typed it in the browser it's giving 404 error so i dont think commenting and uncommenting would help..

aazkan 10-19-2011 04:46 AM

hi Sarah,

Am back, sorry, was fixing dinner and putting my daughter to bed.

If you're getting a 404 on the baseurl itself, perhaps you do need to use the http proxy setting.
Just to test this theory, can you try this on that machine


curl -s http://www.google.com/index.html


and let us know what's the output?

SarahGurung 10-19-2011 04:54 AM

well i tried,it isn't returning any output at all...

you know the same baseurl and mirrolist is their in the slave servers also but there the yum command is working,it is only in the primary nameserver where it is returning that kind of error when using yum..

deep27ak 10-19-2011 04:59 AM

Quote:

Originally Posted by SarahGurung (Post 4502264)
well i tried,it isn't returning any output at all...

you know the same baseurl and mirrolist is their in the slave servers also but there the yum command is working,it is only in the primary nameserver where it is returning that kind of error when using yum..

you said that earlier your boss was using proxy server

So give a check whether that server is stopped?
it might be the issue of proxy server

SarahGurung 10-19-2011 05:03 AM

oh ya it has been stooped....we don't use that anymore.....
even if it is because of that proxy,can u please tell me why the command isnt working only in the primary nameserver then?
i even tried the "yum --disableplugin=fastestmirror check-update -d6" as u said but it gave the following error:

Config time: 0.100
Yum Version: 3.2.22
Setting up Package Sacks


Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...86&repo=addons error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

aazkan 10-19-2011 05:03 AM

That curl command ought to have output either one

a. curl command not found (curl isn't installed)
b. an output similar to this

curl -s http://www.google.com/index.html
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com.my/index.html">here</A>.
</BODY></HTML>

on the slave servers, can you try

set|grep -i http*proxy
grep -i http*proxy /etc/yum.conf

to check if there is any http proxy set or used.

This is kind a wild guess but can you also try

iptables -L -nv | grep -A 3 OUTPUT

on the master

SarahGurung 10-19-2011 05:11 AM

well when i tried those commands in slave servers,it didnt return any output..

and for iptables -L -nv | grep -A 3 OUTPUT inthe master it gave the following output:

Chain OUTPUT (policy ACCEPT 1717K packets, 165M bytes)
pkts bytes target prot opt in out source destination

Chain RH-Firewall-1-INPUT (2 references)

aazkan 10-19-2011 05:12 AM

From what you explained, something is blocking yum from fetching data from centOS mirror.
Without knowing how the server is connected in your LAN to WAN, i'm just making guesses what could have gone wrong (or right)

What kind bugs me is the curl did not give any output... almost tempted to suggest wget next :p

SarahGurung 10-19-2011 05:25 AM

well i even did the commenting and uncommenting thing as suggested but still i got the same error...

in fact none of the commands using yum are working..

eveb tried "yum --disableplugin=fastestmirror check-update -d6"but ...

SarahGurung 10-19-2011 05:44 AM

can anyone help me please..

aazkan 10-19-2011 05:45 AM

Sarah, would you want to try with re- installing yum?

deep27ak 10-19-2011 05:45 AM

ok now I want to give a random hit

are you using IPV6?
just do as following

Code:

#service ip6tables stop
Create a file under /etc/modprobe.d (e.g. “blacklist-ipv6.conf”) with the following 2 lines, in the order shown:
Code:

#cd /etc/modeprobe.d
#vi blacklist-ipv6.conf
install ipv6 /bin/true
blacklist ipv6

Code:

add the following line to /etc/sysconfig/network
NETWORKING_IPV6=no


This is something which I found on Google....

SarahGurung 10-19-2011 05:47 AM

well we havent used ipv6 so far....we use ipv4 only..


All times are GMT -5. The time now is 04:50 AM.