Problem scenario
You are using RedHat Enterprise Linux in AWS. curl commands are not working. DNS names are not resolving accurately. For example, you try this command: curl http://icanhazip.com
You get this error:
"curl: (6) Could not resolve host: icanhazip.com; Unknown error"
How do you fix this to get curl commands to work (and make sure that FQDNs resolve properly)?
Solution
Do these four things:
1. sudo cp /etc/modprobe.d/disableipv6.conf /etc/modprobe.d/bak.disableipv6.conf.bak
2. sudo su -
3. echo "install ipv6 /bin/true" >> /etc/modprobe.d/disableipv6.conf
4. Reboot the server.
does not work
If this did not work, was there an error message? If there was no error message, what step did you get to when there was a problem?