Curl: (6) could not resolve host – What’s wrong?
If you are using Linux, you are probably familiar with Terminal, which is a software program that allows the user to communicate with the computer by running pre-installed commands. When you try to install a new application 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, IPv6 is enabled. Second, the DNS server is wrong. Below, we will show you how 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 are the detailed instructions:
- Open Terminal -> Type su and press Enter to log in as the superuser.
- Enter the root password.
- Change the directory cd/etc/modprobe.d/ to /etc/modprobe.d/
- Type vi disableipv6.conf to create a new file.
- Press the key combination Esc + I to insert data into the file you have already created.
- Enter install ipv6 /bin/true in the file 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 have successfully disabled IPv6.
The second method to deal with this error Curl: (6) could not resolve host is to add a Google DNS server. Let’s follow the steps below:
- Open Terminal -> Type su and press Enter to log in as the superuser.
- Enter the root password.
- To check which DNS server you are using, type cat /etc/resolv.conf.
- Google’s public DNS servers can help you fix this problem. 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 to modify the file resolv.conf.
- Press the key combination Esc + I to insert data into the file.
- Insert # at the beginning of each line -> Add the following two lines to the file:
nameserver 8.8.8.8
nameserver 8.8.4.4
- Type Esc + : -> Type wp to save and exit.
That’s it; you don’t need to restart. The error should now be gone!
Conclusion
To sum up, these are two helpful solutions that many users rate highly. We hope that they will also help you tackle the error Curl: (6) could not resolve host effectively. If you have any questions, please leave a comment below and we will answer you as soon as possible.
Furthermore, if you are looking for fast-loading, SEO-friendly and responsive free WordPress themes and Joomla 4 Templates, don’t hesitate to visit our site and explore the collection.















