I was trying to figure out why I couldn’t get some command line curl requests to work. Turns out /etc/hosts has:
I thought maybe my scripts were installing that , but it seems to be coming from hst-install-ubuntu.sh:
if [[ -z $(grep -i "$servername" /etc/hosts) ]]; then echo "127.0.0.1 $servername" >> /etc/hosts fi
Is there a reason for that? If I comment it out, it works fine:
curl -4 http://admin.mydomain.com:8338/fail2ban 126.96.36.199 188.8.131.52 184.108.40.206 220.127.116.11
But with that line in the /etc/hosts, I get:
curl -4 http://admin.mydomain.com:8338/fail2ban curl: (7) Failed to connect to admin.mydomain.com port 8338: Connection refused
I’ve commented it out for now so that it works, but I just want to try and understand why its in there, and if its important I leave it?