yum installation domain name resolution failed

context

Usually you need to use yum to install software, or wget to download packages

question

If there is a problem with the dns configuration, there will be an inaccessible situation, such as "Couldn't resolve host 'xxxxx".

Solution

  The file /etc/resolv.conf configures the DNS client. It contains the host's domain name search order and the address of the DNS server. Each line should contain a keyword and one or more parameters separated by spaces. The following is an example file: 

  search mydom.edu.cn
  nameserver 210.34.0.14
  nameserver 210.34.0.2 The

  legal parameters and their meanings are as follows:

  nameserver Indicates the IP address of the DNS server. There can be many lines of nameserver, each with an IP address. When querying, it is performed in the order of nameservers in this file, and the following nameservers are queried only when the first nameserver does not respond. 

  domain declares the domain name of the host. It is used by many programs, such as mail systems; it is also used when doing DNS queries for hosts that do not have a domain name. If there is no domain name, the hostname will be used, removing everything before the first dot ( .). 

  search Its multiple parameters specify the domain name query order. When querying a host without a domain name, the host will be looked up separately in the domain declared by search. domain and search cannot coexist; if both exist, the latter will be used. 

  sortlist allows specific sorting of the resulting domain names. Its arguments are net/mask pairs, allowing arbitrary permutation order.

 

       Add the correct and correct nameserver  service.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327043851&siteId=291194637