The tutorial addresses the cPanel curl not found issue caused by missing hostnames and nameservers. It provides a step-by-step guide to set up the hostname, update the /etc/hosts file, configure nameservers, restart the networking service, and verify changes.
- Open Terminal or SSH into your server:
Use your preferred terminal or SSH client to connect to your server. - Set the Hostname:
Run the following command to set the hostname:
hostnamectl set-hostname yourhostname.example.com
Replace “yourhostname.example.com” with your desired hostname.
- Update the /etc/hosts file:
Open the/etc/hosts
file using a text editor:
nano /etc/hosts
Add the following line:
your_server_ip yourhostname.example.com
Save and exit.
- Update Nameservers:
Edit the/etc/resolv.conf
file:
nano /etc/resolv.conf
Add your nameservers:
nameserver 8.8.8.8
nameserver 8.8.4.4
Replace these with your preferred nameservers. Save and exit.
- Restart Networking Service:
Restart the networking service to apply changes:
systemctl restart network
- Verify Changes:
Check if the hostname is set correctly:
hostname
It should display your chosen hostname.
- Verify Curl:
Test if curl is now working:
curl http://google.com
Replace “google.com” with any valid URL. If the curl is working, you’ve resolved the issue.