Temporary failure in name resolution

最近在使用yum方式安装perl-DBD-MySQL时碰到了Temporary failure in name resolution,Trying other mirror。即命名解析失败,尝试使用其它镜像。由于本机为最近安装的新服务器,下面是这个问题的现象描述及处理过程。

1、故障现象
###当前环境
[[email protected] ~]# cat /etc/issue
CentOS release 5.11 (Final)
Kernel \r on an \m

[[email protected] ~]# yum install perl-DBD-MySQL
              ..............
http://mirrors.pubyun.com/centos/5.11/os/x86_64/CentOS/mysql-5.0.95-5.el5_9.x86_64.rpm:
    [Errno 4] IOError: <urlopen error (-3, ‘Temporary failure in name resolution‘)> Trying other mirror.
http://mirrors.sina.cn/centos/5.11/os/x86_64/CentOS/mysql-5.0.95-5.el5_9.x86_64.rpm:
    [Errno 4] IOError: <urlopen error (-3, ‘Temporary failure in name resolution‘)> Trying other mirror.

Error Downloading Packages:
  mysql-5.0.95-5.el5_9.x86_64: failure:
      CentOS/mysql-5.0.95-5.el5_9.x86_64.rpm from base: [Errno 256] No more mirrors to try.
  perl-DBI-1.52-2.el5.x86_64: failure:
      CentOS/perl-DBI-1.52-2.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try.
  perl-DBD-MySQL-3.0007-2.el5.x86_64: failure:
      CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try.

###尝试ping百度,结果提示未知的主机
[[email protected] yum.repos.d]# ping www.baidu.com
ping: unknown host www.baidu.com
[[email protected] yum.repos.d]# ping www.baidu.com
ping: unknown host www.baidu.com

2、故障解决
###结合上面的错误提示及无法ping通百度,应该是dns解析未配置
[[email protected] yum.repos.d]# more /etc/resolv.conf  ###未配置dns解析

###添加dns解析
[[email protected] yum.repos.d]# echo "
> nameserver 121.14.37.62
> nameserver 203.196.0.6">>/etc/resolv.conf

[[email protected] yum.repos.d]# ping www.baidu.com
PING www.a.shifen.com (119.75.217.109) 56(84) bytes of data.
64 bytes from 119.75.217.109: icmp_seq=1 ttl=52 time=38.7 ms
64 bytes from 119.75.217.109: icmp_seq=2 ttl=52 time=38.8 ms
64 bytes from 119.75.217.109: icmp_seq=3 ttl=52 time=38.7 ms
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 6078ms
rtt min/avg/max/mdev = 38.711/38.742/38.801/0.165 ms

###再次yum perl-DBD-MySQL时成功
[[email protected] yum.repos.d]# yum install perl-DBD-MySQL
   .......
Is this ok [y/N]: y
Downloading Packages:
(1/3): perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm                 | 148 kB     00:00     
(2/3): perl-DBI-1.52-2.el5.x86_64.rpm                         | 600 kB     00:00     
(3/3): mysql-5.0.95-5.el5_9.x86_64.rpm                        | 4.9 MB     00:00     
-------------------------------------------------------------------------------------
Total                                                349 kB/s | 5.6 MB     00:16     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-DBI                                                      1/3
  Installing     : mysql                                                         2/3
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
  Installing     : perl-DBD-MySQL                                                3/3

Installed:
  perl-DBD-MySQL.x86_64 0:3.0007-2.el5

Dependency Installed:
  mysql.x86_64 0:5.0.95-5.el5_9                                 perl-DBI.x86_64 0:1.52-2.el5

Complete!

时间: 2024-10-13 08:56:21

Temporary failure in name resolution的相关文章

IP address could not be resolved: Temporary failure in name resolution

今早发现mysql日志中有非常多例如以下的警告: 140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution 140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution

Parrot Temporary failure in name resolution

问题 ping www.baidu.com 出现 Resolving www.baidu.com... failed: Temporary failure in name resolution. 尝试root权限下修改 /etc/resolv.conf ,但失败,提示:"resolv.conf" E212: Can't open linked file for writing 现场 网络是通的 ping ip 是正常的 未对网络设置代理.dns之类操作 解决方案 1, sudo rm

ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly

问题出现的情景:使用git pull拉取开发的代码到测试服务器,报错: ssh: Could not resolve hostname git.****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly 解决: 1.确定本地的ssh相关的文件是正确的(参考[本地服务器配置Git]) 2.尝试了网上的方法,不是没root权限无法执行就是没解决问题,后来找运维解决了 原因

运行ntpdate报错:Temporary failure in name resolution

发现问题: 忽然发现某台机器时间慢了些几分钟,之前没有搭建ntpd服务,目前都是使用的ntpdate加定时任务进行时间同步.直接执行ntpdate报错如下: # ntpdate cn.pool.ntp.orgExiting, name server cannot be used: Temporary failure in name resolution (-3) 3 Sep 15:46:46 ntpdate[13742]: name server cannot be used: Temporar

SpringBoot之解决云服务器VPS在所处云端集群的内网不能解析域名的问题:java.net.UnknownHostException:abc.cn: Temporary failure in name resolution

一.起因与原因分析过程 前端同学告诉我,说服务器崩了. 请求数据接口,接口有响应,但报的json提示指向:数据库异常错误. 遂登陆云主机查看日志,核心记录显示如下: 2018-11-09 22:15:53.824 ERROR 26088 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization. com.mysql.jdbc.exceptions.jdbc

启动hadoop时候报错:localhost: ssh: Could not resolve hostname localhost: Temporary failure in name resolution”

这个错误是由于配置文件没有配置好.解决方案如下: 1 打开profile文件 vim /etc/profile 2 在文件最后加入的内容应该如下(高亮的两句一般是大家缺少的): export JAVA_HOME=/usr/java/jdk export HADOOP_HOME=/itcast/hadoop-2.6.4 export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/nativeexport HADOOP_OPTS="-Djava.libr

Temporary failure in name resolutionf的解决方法

Linux有时还蛮烦的这个不能用那个不能用,只能多折腾了. 今天又是,ping z.cn的时候直接报错 Temporary failure in name resolutionf 这个一般都知道是DNS的问题. 直接奔目标文件去修改就好了 vim /etc/resolv.conf 文件里的内容一般都是 nameserver 8.8.8.8 加上个你能用的 比如 nameserver 114.114.114.114 什么的,之后reboot即可. Temporary failure in name

linux中显示/设置系统时间

date   显示/设置 系统时间 +某个格式 以某种格式显示日期 格式: +%F  2017-08-20  ====== +%Y-%m-%d +%w 显示周几  0 周日  1-6 周一到周六 +%T  时:分:秒     ====== +%H:%M:%S -d  按照你的描述显示日期 -d "1day"    1天之后  ==== +1day -d "-1day"   1天之前 -s修改系统的时间 1.1 修改系统时间的命令 ntpdatepool.ntp.or

【详解】DNS服务工作原理、正反向解析和主从同步

目录: 一.理论部分 二.实验部分 ******************************理论部分*************************************** 正文: 一.什么是DNS服务. DNS服务是互联网的基础性服务之一.全称为Domain Name System(域名系统).DNS是因特网上作为域名和IP地址相互映射的一个分布式数据库,提供将域名转换成对应IP地址的信息条目,能够使用户更方便的通过域名(如baidu.com)去访问互联网,而不用去记住能够被机器直接