Home >Operation and Maintenance >CentOS >wget cannot resolve host domain name under centos7

wget cannot resolve host domain name under centos7

王林
王林Original
2020-04-01 13:27:284752browse

wget cannot resolve host domain name under centos7

Problem restoration:

[root@localhost XXX]# wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
--2019-10-10 18:26:14-- https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
正在解析主机 cdn.openbsd.org (cdn.openbsd.org)... 失败:域名解析暂时失败。
wget: 无法解析主机地址 “cdn.openbsd.org”

Cause:

Dns problem, you need to configure the dns server.

Solution:

1. Enter the /etc/resolv.conf configuration file

2. Modify or add the content:

nameserver 8.8.8.8

Result:

[root@localhost XXX]# wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
--2019-10-10 18:27:55-- https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
正在解析主机 cdn.openbsd.org (cdn.openbsd.org)... 151.101.2.217, 151.101.66.217, 151.101.130.217, ...
正在连接 cdn.openbsd.org (cdn.openbsd.org)|151.101.2.217|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1597697 (1.5M) [application/octet-stream]
正在保存至: “openssh-8.0p1.tar.gz”
100%
[========================================================================================================================>] 
1,597,697 12.2KB/s 用时 2m 18s

Recommended tutorial: centos tutorial

The above is the detailed content of wget cannot resolve host domain name under centos7. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn