If you saw the error like this:
An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.
It might appear in "Add Themes" and "Add Plugins" pages.
You have to do both of the following actions in order to solve the problem.
1. Disable SELinux
You may need to know how to disable SELinux temporarily or permanently.
2. Install BIND-UTILS
Since the program may need the capability of network resolution internally, so we install bind-utils to get essential network tools ready for it.
[root@web ~]# yum info bind-utils
In this case, we use yum to install the package.
[root@web ~]# yum -y install bind-utils
For Debian distros, you can use apt-get to install bind-utils. After that, please log out your session, reopen your browser and get into the page, then you can see the correct result.
If the above method failed, you may add an explicit entry to /etc/hosts as the last resort.
[root@web ~]# vi /etc/hosts