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

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

[root@GZDB ~]# 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百度,结果提示未知的主机
[root@GZDB yum.repos.d]# ping www.baidu.com
ping: unknown host www.baidu.com
[root@GZDB yum.repos.d]# ping www.baidu.com
ping: unknown host www.baidu.com

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

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

[root@GZDB 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时成功
[root@GZDB 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!

Temporary failure in name resolution相关推荐

  1. ssh:could not resolve hostname XXX:Temporary failure in name resolution

    今天使用虚拟机提交github项目发现出现: ssh:could not resolve hostname XXX:Temporary failure in name resolution 先是pin ...

  2. pip install 命令报错Temporary failure in name resolution

    pip install 命令报如下错误 Collecting labelmeUsing cached https://files.pythonhosted.org/packages/79/a4/01b ...

  3. 树莓派Linux-raspberrypi域名解析失败:Temporary failure in name resolution

    最近在树莓派上安装了Linux系统,配置完网络后发现ping不通baidu,提示: Temporary failure in name resolution 编辑 /etc/dhcpcd.conf 文 ...

  4. ping: www.baidu.com: Temporary failure in name resolution

    虚拟机突然访问不了百度了, 查看发现网络都是好的 [root@zk02 ~]# ping www.baidu.com ping: www.baidu.com: Temporary failure in ...

  5. Temporary failure in name resolution错误解决方法

    今天迁移服务器之后原本正常运行的程序报"Temporary failure in name resolution"错误,意思是域名解析失败,但是DNS什么的设置没有问题,其实是主机 ...

  6. 遇到问题---eks--gitlab-runner----docker dns解析失败---docker build Temporary failure in name resolution

    情况 使用eks集群部署了一个gitlab-runner用来做ci/cd,但是发现 gitlab-runner这个pod中 去下载包时报错 docker build Temporary failure ...

  7. MySQL could not be resolved: Temporary failure in name resolution报错解决方法

    最近几天研发总是抱怨用Navicat连接MySQL数据库和打开数据表很慢,登录数据库分析,查看错误日志: mysql> show variables like 'log_error'; +--- ...

  8. 解决Ubuntu 下域名解析出现ping: www.baidu.com: Temporary failure in name resolution及重启后/etc/resolvconf文件内容被重写

    解决Ubuntu 下域名解析出现ping: www.baidu.com: Temporary failure in name resolution及重启后/etc/resolvconf文件内容被覆盖置 ...

  9. ping: mirrors.aliyun.com: Temporary failure in name resolution

    问题 因为学习 OpenStack ,虚拟机增加一块网卡,结果 apt update 出错了! Temporary failure in name resolution 新增加的网卡 203.0.11 ...

最新文章

  1. method initializationerror not found:JUnit4单元测试报错问题
  2. 140个绝对绝对值得收藏的电脑技巧1
  3. 一天一个C++程序(六)
  4. python:动态参数*args
  5. Spring Boot文档阅读笔记-对Securing a Web Application解析
  6. python 享元模式_设计模式-创建型模式,python享元模式 、python单例模式(7)
  7. Python学习-9.Python函数定义
  8. AbstractFactory(抽象工厂)
  9. java.io.IOException: http://XXX provided port:50000 is not reachable
  10. html调用java函数_html通过JavaScript调用java代码
  11. 什么是十六进制法_十六进制计算方法是什么?
  12. 顺丰速运中山php招聘信息_中山顺丰快递招聘
  13. html个人空间制作,html+css+js制作简单网站首页
  14. 松下P2卡数据恢复-删除/格式化100%完美恢复-解决方案
  15. doodoo.js快速入门教程 1
  16. 隆重推出 Incredibuild 10
  17. 安全测试找工作没有经验怎么办?
  18. mysql和ocr_图文识别OCR的作用和优势是什么?
  19. 微信小程序教学管理系统+后台管理系统
  20. Python最简单的文字游戏——数字炸弹

热门文章

  1. redmine升级了 ,6与18日同时发布2.0.3和1.4.4
  2. 用JQuery模仿淘宝的图片显示效果
  3. Hyper-V 网卡 load failed
  4. 长短视频之争,长视频平台和短视频源码谁主沉浮?
  5. iOS主线程耗时检测方案
  6. Material Design 设计规范总结(2)
  7. 理论与实践中的CNN模型结构,如何引领深度学习热潮
  8. C#关于值类型和引用类型的备忘
  9. 分布式任务分发框架Gearman测试、性能监控、队列持久化【python 实例】
  10. c# 字符串是否相等