As Linux users continue to skillfully nurture and grow their user experience, they soon realize that they become more performant and productive while in the Linux command-line environment.
The Linux OS environment exposes its users to terminal-based tools like Curl for a non-interactive download and upload of targeted network/internet-based files, which is similar to the Wget utility and both share some similarities in their implementation and functionalities.
The primary role of the Curl utility as highlighted on its manual page is to transfer a targeted URL.
$ man curl
It supports numerous protocols with the common ones being FTP, FTPS, HTTP, HTTPS, SCP, SFTP, SMTP, and SMTP.
The Curl command syntax is as follows:
$ curl [options / URLs]
We can show its implementation by using it with a random URL.
$ curl https://google.com -o linuxshelltips.txt
In the above command, Curl’s findings from accessing the highlighted URL are saved in the succeeding text file.
curl: (6) could not resolve host Error
Mostly, such an error occurs when there is an issue with a Linux server’s DNS resolver. A Linux administrator will categorize/define this challenge as a server management service issue.
This error is likely to take several forms when the curl command is executed from the Linux terminal and the most popular ones include:
- curl: (6) could not resolve host: domain_name.extension; Name or service not known
- curl: (6) could not resolve host: domain_name.extension e.g. linuxshelltips.com
- curl: (6) could not resolve host: application
Now that we have highlighted the primary reason that might be behind the stated curl command error during its execution on a Linux terminal, it’s time to fix the problem.
Solution 1: Missing Working DNS Nameserver
A nameserver is basically a bridge between a working/purchased domain name and the IP address of a server. When you purchase or subscribe to a domain name, and before you use/link this domain name to your remote Linux server, you need to configure a DNS nameserver. A DNS nameserver enables a user to use a domain name to access a remote server instead of using its IP address.
On your Linux server/machine, the file /etc/resolv.conf is responsible for the DNS nameserver entries auto-generated by NetworkManager.
$ sudo nano /etc/resolv.conf
This file can hold more than one DNS nameserver entry. As you might have noted, the syntax for adding a DNS nameserver entry in this file should resemble the following:
nameserver IP.ADDRESS
For instance, if you were to add Google public nameservers to this file, it would look like the following:
nameserver 192.168.100.1 nameserver 8.8.8.8 nameserver 8.8.4.4
If you are using a private DNS nameserver, add it to the /etc/resolv.conf file. Update or reboot the system if possible and the host should start resolving.
Solution 2: Curl Syntax Errors
Make sure the curl command execution adheres to its correct syntax usage. A syntax error can arise from something as simple as the misuse of an escape sequence (/)
or an illegal spacing on the URL.
The curl: (6) could not resolve host error in Linux primarily relates to wrongful/missing DNS nameserver setup or a random syntax error that can be scanned and fixed.
when I try to load a web page to terminal it gives curl: (6) Could not resolve host
error.
I have internet in my PC and trying from my home internet connection. So as I there is no any proxy involve here.
[root@localhost kevin]# curl http://google.com
curl: (6) Could not resolve host: google.com; Name or service not known
clean all
and tried again but no lucky.
But if I use IP instead of the domain name, it works fine.
[root@localhost kevin]# curl http://173.194.46.0
any clue please?
Sathish
3,7001 gold badge16 silver badges28 bronze badges
asked Jul 26, 2014 at 5:26
Nayana AdassuriyaNayana Adassuriya
23k28 gold badges103 silver badges145 bronze badges
5
Issues were:
- IPV6 enabled
- Wrong DNS server
Here is how I fixed it:
IPV6 Disabling
- Open Terminal
- Type
su
and enter to log in as the super user - Enter the root password
- Type
cd /etc/modprobe.d/
to change directory to/etc/modprobe.d/
- Type
vi disableipv6.conf
to create a new file there - Press
Esc + i
to insert data to file - Type
install ipv6 /bin/true
on the file to avoid loading IPV6 related modules - Type
Esc + :
and thenwq
for save and exit - Type
reboot
to restart fedora - After reboot open terminal and type
lsmod | grep ipv6
- If no result, it means you properly disabled IPV6
Add Google DNS server
- Open Terminal
- Type
su
and enter to log in as the super user - Enter the root password
- Type
cat /etc/resolv.conf
to check what DNS server your Fedora using. Mostly this will be your Modem IP address. - Now we have to Find a powerful DNS server. Luckily there is a open DNS server maintain by Google.
- Go to this page and find out what are the «Google Public DNS IP addresses»
- Today those are
8.8.8.8
and8.8.4.4
. But in future those may change. - Type
vi /etc/resolv.conf
to edit theresolv.conf
file - Press
Esc + i
for insert data to file - Comment all the things in the file by inserting # at the begin of the each line. Do not delete anything because can be useful in future.
-
Type below two lines in the file
nameserver 8.8.8.8
nameserver 8.8.4.4-Type
Esc + :
and thenwq
for save and exit - Now you are done and everything works fine (Not necessary to restart).
- But every time when you restart the computer your /etc/resolv.conf will be replaced by default. So I’ll let you find a way to avoid that.
Here is my blog post about this:
http://codeketchup.blogspot.sg/2014/07/how-to-fix-curl-6-could-not-resolve.html
answered Jul 28, 2014 at 1:29
Nayana AdassuriyaNayana Adassuriya
23k28 gold badges103 silver badges145 bronze badges
4
Perhaps you have some very weird and restrictive SELinux rules in place?
If not, try strace -o /tmp/wtf -fF curl -v google.com
and try to spot from /tmp/wtf
output file what’s going on.
answered Jul 26, 2014 at 11:12
5
I have today similar problem. But weirder.
- host — works
host pl.archive.ubuntu.com
- dig — works on default and on all other DNS’s
dig pl.archive.ubuntu.com
,dig @127.0.1.1 pl.archive.ubuntu.com
- curl — doesn’t work! but for some addresses it does. WEIRD! Same in Ruby, APT and many more.
$ curl -v http://google.com/
* Trying 172.217.18.78...
* Connected to google.com (172.217.18.78) port 80 (#0)
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Type: text/html; charset=UTF-8
< Referrer-Policy: no-referrer
< Location: http://www.google.pl/?gfe_rd=cr&ei=pt9UWfqXL4uBX_W5n8gB
< Content-Length: 256
< Date: Thu, 29 Jun 2017 11:08:22 GMT
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.pl/?gfe_rd=cr&ei=pt9UWfqXL4uBX_W5n8gB">here</A>.
</BODY></HTML>
* Connection #0 to host google.com left intact
$ curl -v http://pl.archive.ubuntu.com/
* Could not resolve host: pl.archive.ubuntu.com
* Closing connection 0
curl: (6) Could not resolve host: pl.archive.ubuntu.com
Revelation
Eventually I used strace
on curl and found that it was connection to nscd
deamon.
connect(4, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = 0
Solution
I’ve restarted the nscd service (Name Service Cache Daemon) and it helped to solve this issue!
systemctl restart nscd.service
answered Jun 29, 2017 at 11:29
3
There is no need to disable IPv6 as the answer suggests. The reason curl fails is simply because the DNS resolution is missing.
There is one liner solution to this.
If you care about what is inside /etc/resolv.conf
then append it:
echo 'nameserver 1.1.1.1' | sudo tee -a /etc/resolv.conf >/dev/null
I usually don’t care and just replace the content of the file:
echo 'nameserver 1.1.1.1' | sudo tee /etc/resolv.conf >/dev/null
answered Oct 11, 2021 at 17:33
HoumanHouman
63.2k86 gold badges266 silver badges455 bronze badges
0
Try nslookup google.com to determine if there’s a DNS issue.
192.168.1.254 is your local network address and it looks like your system is using it as a DNS server. Is this your gateway/modem router as well?
What happens when you try ping google.com. Can you browse to it on a Internet web browser?
answered Jul 26, 2014 at 13:25
2
In Our case, the command was passed through mail/skype and the person who needs to execute copied an extra space.
we found that extra space after an hour and removing that made it work.
answered Aug 6, 2022 at 3:20
nikhil2000nikhil2000
1493 silver badges13 bronze badges
I had an issue with IPV6 that suddenly showed up in wordpress admin where curl failed to connect to wordpress.org etc giving
An unexpected error occurred. Something may be wrong with WordPress.org
and also
Installation failed: Download failed. cURL error 28: Resolving timed out after 10005 milliseconds
I eventually sorted by adding the following as a php file in mu-plugins:
add_action( 'http_api_curl', function( $curl_handle ) { curl_setopt( $curl_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );});
and also when using curl directly in php by using the following option in the options array:
curl_setopt_array($curl, array(CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4));
The OS is IBM i (OS400/i5OS) v7.2 running on Power 6 and the php version is 8.1.10. Interestingly IPV6 is not active on the box.
answered Sep 17, 2022 at 11:37
Are you curious to know why does the error ‘curl (6) could not resolve host ubuntu’ appear?
Usually, such curl errors happen when there are problems with DNS resolvers on the server.
At Bobcares, we often get requests from our customers to fix curl (6) could not resolve host Ubuntu as part of our Server Management Services.
Today, let’s discuss why this error occurs and see how our Support Engineers fix it.
What is curl (6) could not resolve host?
Many of our customers have experienced this error ‘curl (6) could not resolve host’ while trying to connect to a webpage from the terminal.
This error mainly occurs due to a wrong DNS set up or bad settings on the server.
Also, we’ve seen this error appearing in different ways which include.
- curl: (6) Could not resolve host: application
- curl: (6) Could not resolve host: domain.com
- curl: (6) Could not resolve host: google.com; Name or service not known
This essentially means the server was not able to connect to the remote host.
How we fixed the error curl (6) could not resolve host in ubuntu
At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while managing a server.
Now, let’s see the major reasons for curl errors and how our Support Engineers fix this error.
1. Missing working DNS nameserver
Sometimes, users may receive a problem when trying to install packages like wget, apt-get not being able to resolve hosts.
For example, when executing a command apt-get install wget.
Users may get an error as curl#6 - "Could not resolve host: repo.xxx.com; Unknown error"
This mainly occurs when we don’t have nameservers in the /etc/resolv.conf
So, we added the following line in the file.
nameserver 8.8.8.8
Then, this fixed the error and the host started resolving.
2. Syntax error
Recently, one of our customers had a problem while executing the command curl on his terminal. He used the command as below,
curl -X 'GET https://www.mywebsite.com/Web2/PDF.aspx?page=1'
Also, the error said Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36 OPR/51.0.2830.26'
curl: (6) Could not resolve host:
On checking, our Support Engineers found that the error was due to the incorrect syntax used to access the website.
So, we corrected the syntax as below. This happened as he had included space after one of the / escape sequences.
curl -X GET https://www.mywebsite.com/Web2/PDF.aspx?page=1/
Similarly, an error happened when running the following command
curl -i -H 'Content-Type: application/json' -d '{"Code":"FR","Name":"France"}' http://127.0.0.1:8080/countries
The error said Curl: (6) Could not resolve host: application.
This error was also due to the syntax error in the command. Thus, we resolved this problem editing like this in windows:
"{/"Code/":/"FR/"}"
In another case, we corrected it by deleting an extra space from the command.
curl -H Content-Type:application/json ~
Finally, this fixed the error.
[Need more help to solve curl error?- We’ll fix it for you.]
Conclusion
In short, an error curl (6) could not resolve host on ubuntu happens due to syntax error or due to the wrong DNS set up. Today, we saw how our Support Engineers assisted our customers to solve this error.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;
Getting this error message when trying to work with passport in my project on my local server.
CurlFactory.php line 186:
cURL error 6: Could not resolve host: api.project.local (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
{
"token_type": "Bearer",
"expires_in": 518399,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijk0MWU3Y2Q2Y2I1ZTEyYmYyYzAzYTIzY2I1YWM5YjY3YjI0MmU2NTUwOWRhODVlZTMxNzc3MjIwODA3ZTA2ZGY1YWIwYjMzNDg2MDA2MTZlIn0.eyJhdWQiOiIxIiwianRpIjoiOTQxZTdjZDZjYjVlMTJiZjJjMDNhMjNjYjVhYzliNjdiMjQyZTY1NTA5ZGE4NWVlMzE3NzcyMjA-rkLpvJhuju4Qlo0QNjsXUUHXq6GyqqiQTNa2d0IUsWdAOSLsy1bMu4Z2ga_Jj1L1ThwbDOfy7kE4_5SDfKKIyKXO_-iw",
"refresh_token": "L8p2NAqRZfi1fP1XyO3NW36dCqa6HZJWgNKkuR8IMz2LJe5711nRHPMP734caln1+8m+GC6K79yTjRjru01iR7LKP1CCseixQ8mkzXWZb+roQv32qdkXVSeCzObecOI2ZWq+l1KNs12NA3KIZJ4bS0N2rOYxlw3KTNx55uydH13vmanbeXIpym0ha8op0M9s9HvwPc+dJUhjL20JzDGCcyuhciGIe6CTKyBuqi4dNA8tIeALLPSSqtvd0QsRWCWTVBL72RVeEeIq/4kFppE="
}
install laravel 5.3
install passport package
extract laravel auth scaffold to app directory.
put this line of code inside of authentication controller when user is logged in :
path = Project/app/Foundation/Auth/AuthenticatesUsers.php
$http = new Client;
$response = $http->post('Project.local/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => 1,
'client_secret' => 'xKqNbzcXyjySg20nVuVLw5nk5PAMhFQOQwRTeTjd',
'username' => $userobject['email'],
'password' => $userobject['password'],
'scope' => '',
],
]);
On some servers it works, on some it doesn’t and I don’t know what is the cause. the server I’m facing problem right now is ubuntu14.04 server with php5.6 and apache2 and mysql5.5
Curl: (6) could not resolve host – What’s wrong?
If you are using Linux, you are not too unfamiliar with Terminal, which is a software program that allows the user to communicate with the computer by running pre-installed commands. When you are trying to install a new application for using Terminal, you may get the error Curl: (6) could not resolve host.
If you are facing the error Curl: (6) could not resolve host, there may be 2 reasons for that. First of all, IPV6 was enabled. And another one is the wrong DNS server. So, if you are troubled because of one of the two reasons above, we will bring you the ways to disable IPV6 and add a Google DNS server to deal with this error. Let’s get started now!
How to fix Curl: (6) could not resolve host
As we mentioned above, the first solution we will show you is how to disable IPV6 to solve the error Curl: (6) could not resolve host. Here is the detailed instruction:
- Open Terminal -> Type su and enter in order to log in as the super user.
- Fill out the root password.
- Change the directory cd/etc/modprobe.d/ to /etc/modprobe.d/
- Type vi disableipv6.conf and generate a new file.
- Press the combination key Esc + I to insert data into the file you have already created.
- Enter install ipv6 /bin/true on the file in order to avoid loading modules related to IPV6.
- Type Esc + : -> Type wp to save and exit.
- Enter reboot to restart fedora -> Open terminal -> Type lsmod | grep ipv6
- Now, if there is no result, you succeed in disabling IPV6.
The second method to deal with this error Curl: (6) could not resolve host is to add Google DNS server. Let’s follow the steps below:
- Open Terminal -> Type su and enter in order to log in as the super user.
- Fill out the root password.
- In order to check what DNS server you are using, let’s type cat /etc/resolv.conf.
- An open DNS server maintained by Google can help you to address this trouble. They are 8.8.8.8 and 8.8.4.4 but they may change in the future. Learn more here.
- Enter vi /etc/resolv.conf in order to modify the file resolv.conf.
- Press the combination key Esc + I to insert data into the file.
- Insert # at the beginning of each line -> Fill out the two following lines in the file:
nameserver 8.8.8.8
nameserver 8.8.4.4
- Type Esc + : -> Type wp to save and exit.
Everything is done and you don’t need to restart. The error will disappear now!
Conclusion
To sum up, they are the two helpful solutions that are rated by many users. So, we hope that they will also support you to tackle the error Curl: (6) could not resolve host effectively. If you have any questions, please leave your comment below and we will answer you as soon as possible.
Furthermore, if you are finding some fast-loading speed, SEO-friendly and responsive free WordPress themes and Joomla 4 Templates, don’t hesitate to visit our site and explore the collection.
- Author
- Recent Posts
Welcome to LT Digital Team, we’re small team with 5 digital content marketers. We make daily blogs for Joomla! and WordPress CMS, support customers and everyone who has issues with these CMSs and solve any issues with blog instruction posts, trusted by over 1.5 million readers worldwide.
I have a CentOS 7.3 machine that is a guest running on Oracle VirtualBox. The host is a Windows machine. I can ping 8.8.8.8 from the Linux server. The Linux server can ping itself by its hostname ping coolvm
. As root I recently did a yum -y update
command. That is when curl stopped working. FQDNs will not resolve.
If I try this:
curl -v http://www.google.com
I get this error:
- Could not resolve host: www.google.com; Unknown error
- Closing connection 0 curl: (6) COuld not resolve host: www.google.com; Unknown error
The commands nslookup, dig and host have not been installed. I cannot install new Yum packages because I get an error related to host resolution («Resolving time out»).
The /etc/resolv.conf file looks like this:
# Generated by NetworkManager
search localdomain
nameserver 8.8.8.8
nameserver 8.8.4.4
I tried rebooting the host machine (and thus the guest too). But that did not help me. Browsing the internet has not changed.
The interface for the main NIC in /etc/sysconfig/network-scripts/ has DNS server stanzas that have worked in the past. The interface file is standard and complete. I have not changed it since the yum -y update
command.
How can I get FQDNs to resolve? I want to use the Lynx command. My repositories rely on FQDNs to resolve. I cannot use yum to install packages.
Update. I ran this command:
cat /etc/nsswitch.conf | grep -i hosts
I saw this:
#hosts: db files nisplus nis dns
hosts: files dns myhostname
Буквально пару дней назад переносили сайт на WordPress на обновленный сервер, и столкнулись с проблемой установки обновлений и новых плагинов. Если поискать в интернете, видно, что люди часто сталкиваются с такой ошибкой и предлагается всего 2 варианта решения:
- Подождите, может, само рассосется
- Обратитесь к системному администратору
Ждать — не вариант. Если вы используете виртуальный хостинг одного из хостеров, то техподдержка должна решить эту проблему достаточно быстро. А если вы арендовали VPS и сами себе администратор, то информация ниже поможет вам решить проблему.
Как проявляется ошибка
Ошибка возникает при попытке установить обновление WordPress, обновить темы оформления или установить новый плагин. При этом появляется сообщение «Warning: Произошла непредвиденная ошибка. Возможно, что-то не так с сайтом WordPress.org или с настройками вашего сервера. Если проблема не решится, обратитесь на форумы поддержки. (Не удалось установить защищённое соединение с WordPress.org. Пожалуйста, свяжитесь с администратором сервера)».
В логах сервера фигурируют следующие файлы, в которых возникает ошибка:
/wp-admin/includes/plugin-install.php
/wp-admin/includes/translation-install.php
/wp-admin/includes/update.php
/wp-includes/update.php
Если у вас установлен плагин Health Check & Troubleshooting (кстати, настоятельно рекомендую его установить), то в отчете можно увидеть ошибки вида
cURL error 6: Could not resolve host: api.wordpress.org
Очевидно, что проблема в библиотеке cURL, либо настройках сервера.
Как решить проблему
Нам понадобится доступ к серверу по протоколу SSH и права администратора для внесения изменений в настройки и установки ряда библиотек.
1. Проверяем настройки в файле php.ini
Обычно этот файл находится в папке /etc/php.ini или /etc/php/<версия php>/apache2/php.ini. Убедитесь, что эти две настройки включены:
allow_url_fopen = On
allow_url_include = On
2. Проверяем установку необходимых библиотек с помощью phpinfo()
Создайте на своем сервере файл pi.php в корне сайта со следующим содержимым:
<?php
phpinfo();
Откройте файл в браузере http://<адрес сервера>/pi.php и проверьте, что следующие библиотеки установлены в Enabled
OpenSSL
Socket
3. Проверяем файл resolv.conf
Файл можно найти по адресу /etc/resolv.conf — воспользуйтесь привычным текстовым редактором. Удалите из файла все комментарии, укажите используемые DNS-сервера (рекомендую Google, но вы можете выбрать те, которые нравятся):
nameserver 8.8.8.8
nameserver 8.8.4.4
Сохраните изменения и закройте редактор. Убедитесь, что файл доступен для всех пользователей:
chmod a+r /etc/resolv.conf
4. Если вы используете высокоэффективную связку nginx + php-fpm
Для начала проверяем конфигурацию php-fpm для вашего сайта. Ее можно найти в /etc/php-fpm.d/<имя сайта>.conf. Откройте файл и найдите строку
chroot = <путь к песочнице>
Если строка присутствует и не закомментирована, значит php-fpm работает в режиме chroot, и вам потребуется скопировать часть файлов системы в chroot-окружение, т.к. у php-fpm нет к ним доступа. Для этого переходим в папку, указанную в chroot и выполняем следующие команды:
mkdir etc
mkdir lib64
mkdir usr
mkdir usr/share
cp -p /etc/hosts etc/
cp -p /etc/localtime etc/
cp -p /etc/resolv.conf etc/
cp -p /lib64/libss_dns* lib64/
cp -Rp /usr/share/zoneinfo usr/share/
После выполнения указанных действий перезапускаем php-fpm, и проблема решена.
systemctl restart php-fpm
Если вам требуется сопровождение VPS/VDS-сервера или помощь с настройкой, обратитесь к нам, мы занимаемся настройкой и сопровождением серверов с 2013 года. Порекомендуем хостера, подберем конфигурацию и поможем запустить ваш проект.
Добрый день, уважаемое сообщество.
Прошу помощи тут, так как уже не знаю, что читать и куда смотреть.
Все темы с таким же названием или описанием тут я уже прочитала.
Равно как за эти две недели прочитала и перепробовала кучу разных советов по подобному вопросу на Хабр Q&A, Stack Overflow, cyberforum, coderoad, overcoder и так далее, где эти вопросы хоть раз поднимались и на них давали хоть какой-то ответ.
Обращалась даже к регистратору своего домена, серверами имен которого я пользуюсь, на предмет ограничений с их стороны.
Это было вступление. Теперь по сути.
По какой-то причине я не могу проверить обновления WordPress, загрузить темы или плагины. Site Health пишет:
Your site is unable to reach WordPress.org at api.wordpress.org, and returned the error: cURL error 6: Could not resolve host: api.wordpress.org
Я много раз натыкалась на информацию, что для корректного использования cURL Wordpess должен видеть nameserver’a google.
Я дописала в файл /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
Не помогло.
Я читала, что надо в файле php.ini раскомментировать строку
;extension=curl
Не помогло.
Что надо обновить cURL до последней версии.
sudo apt install -y libcurl4 curl
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Уже установлен пакет curl самой новой версии (7.58.0-2ubuntu3).
Уже установлен пакет libcurl4 самой новой версии (7.58.0-2ubuntu3).
Не помогло.
php -i | grep curl
/etc/php/7.2/cli/conf.d/20-curl.ini,
curl
Ошибок нет.
curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
curl wordpress.org
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
При этом curl api.wordpress.org не показывает никакого вывода. Ни ошибок, ни результата.
Из этого всего могу сделать вывод, что cURL на сервере работает и работает корректно.
И тут мне пришла в голову мысль. А что если api.wordpress.org не нравится мой IPv4 адрес и по умолчанию он пытается использовать IPv6 запросы.
ll@localhost:~$ curl -4 api.wordpress.org
Вывода нет, тест пройден. IPv4 работает.
ll@localhost:~$ curl -6 api.wordpress.org
curl: (6) Could not resolve host: api.wordpress.org
Ошибка, тест провален. IPv6 не работает. И это та же самая ошибка, что и в админке.
Так как мне не хочется платить за IPv6 адрес, но у меня есть белый IPv4 адрес, я бы хотела подружить его с WordPress. А в идеале, чтобы WordPress отправлял обычные запросы на свои сервера, а не привязывал их к протоколам IPv4 и IPv6.
Подскажите пожалуйста, в каком файле движка находятся эти настройки и что там должно быть вместо текущего кода, чтобы эту проблему исправить?
Заранее спасибо.
Сервер на Ubuntu 18.04
PHP 7.2
Версия WordPress 5.6.2
П.С.: отправлять меня менять хостинг или хостера не нужно, так как это мой домашний хостинг и мне куда интереснее находить и исправлять проблемы, а не убегать от них)
П.П.С.: По ссылке вывод из <?php phpinfo(); ?>
-
Тема изменена 1 год, 11 месяцев назад пользователем
annkot.
Страница, с которой нужна помощь: [войдите, чтобы увидеть ссылку]