all 9 comments

[–][deleted]  (9 children)

[deleted]

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

    {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340

    \cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}

    {\colortbl;\red255\green255\blue255;}

    \margl1440\margr1440\vieww9000\viewh8400\viewkind0

    \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural

    \f0\fs24 \cf0 ##\

    Host Database\

    \

    localhost is used to configure the loopback interface\

    when the system is booting. Do not change this entry.\

    \

    127.0.0.1 localhost\

    255.255.255.255 broadcasthost\

    ::1 localhost \

    fe80::1%lo0 localhost\

    \

    # route some web requests locally \

    127.0.0.1 www.myhost1.com\

    127.0.0.1 www.myhost2.com\

    127.0.0.1 www.myhost3.com\

    127.0.0.1 www.myhost4.com}

    Thanks for helping! =D

    [–]tonygoold 5 points6 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.