On linux yum is very useful to install package on operating system.

You may hit this error while try to use yum. So here is the solutions steps but first let us see exact error message:

[root@veridata yum.repos.d]# yum install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 – “Could not resolve host: mirrorlist.centos.org; Unknown error”

  1. Check iptables and if there is any rule delete it
    • iptables -L 
    • iptables -F
  2. run curl http://google.com command. Possibly you will get curl: (6) Could not resolve host: google.com; Name or service not known
  3. Possible problem could be IPV6 is active or wrong DNS info
  4. Follow below steps:
    cd /etc/modprobe.d/
    vi disableipv6.conf
    install ipv6 /bin/true
  5. edit below file
    vi /etc/resolv.conf ====>> Add below line into file
  6. run dhclient command
  7. Rerun curl http://google.com. Similar output will be like that:
 <TITLE>301 Moved</TITLE></HEAD><BODY>                                                                           <H1>301 Moved</H1> The document has moved                                                                                         <A HREF="http://www.google.com/">here</A>.                                                                   </BODY></HTML>