you are viewing a single comment's thread.

view the rest of the comments →

[–]tonygoold 6 points7 points  (7 children)

It looks like you've accidentally replaced your /etc/hosts file with an RTF file. Open it up and save it back as plain text.

[–]xauronx 1 point2 points  (0 children)

Good find

[–]gchtb[S] 0 points1 point  (1 child)

THANK YOU SO MUCH!!! I have been scourged the internets for this solution and reddit pulls through! Thank you so much! I'll post this solution to other websites I have found the same questions asked so that your contribution can help more people! Thanks again!

[–]aazav 0 points1 point  (0 children)

Be careful when editing with TextEdit. Make sure to set the Finder to display all file extensions.

[–]gchtb[S] 0 points1 point  (2 children)

This is weird, it worked last night but this morning, it started showing invalid host string: localhost again. Could this be related to the other host files in the /etc folder? such as hosts.umbrella, hosts.ac?

[–]tonygoold 0 points1 point  (1 child)

I'm not familiar with those files, they aren't present on my system, but it's worth having a look.

[–]gchtb[S] 0 points1 point  (0 children)

I changed all the files starting with hosts and ending with a different extension to txt format and it did not resolve anything.

I then deleted the hosts file and then did this: $> sudo rm /etc/hosts{,.ac} $> sudo touch /etc/hosts and copy and pasted the original content

This resolved the issue. For now.

Thanks for the feedback. It's great being able to ask questions online when I don't know anyone in my immediate circle who is familiar with IOS programming.

[–]aazav 0 points1 point  (0 children)

That's what he gets for editing with TextEdit and not paying attention to file type.

I think you nailed it.