Invalid Host string: Localhost [Resolved]


Hi everyone,

I am a beginner never having learning programming before with exception to some html exposure.

I’m running into trouble with the AGoodStart Project.

I have entered the code as instructed, the Build is Successful - the “Build Succeeded” Icon shows up. However, The debugging part shown in the book doesn’t appear and a “Could not launch AGoodStart” invalid host string: “localhost” icon pops up. I have added a screen shot of what’s seen.

I have triple checked the code I entered to ensure that there aren’t any syntax issues.

If anyone has any suggestions, it would be greatly appreciated. Please keep in mind I am new to programming but I am willing to learn with clear instructions.

Thanks in advance.

Edit**: I moved on to the next project in the book while waiting for a reply and had the exam same issue, it seems like there is something wrong with my Host files on my macbook. Any suggestions?

Edit 2: So I found this solution to the problem, but I don’t quite understand step two “Execute ‘dscacheutil -flushcache’ to reload the DNS configuration” Can someone explain?
Link: … -localhost


Hmm. This is very strange.

The command that stack overflow suggests must be run from the Terminal app, which is located in /Applications/Utilities/

Give it a try…

I’m sorry – I’ve never seen this.


Hi Aaron,

Thanks for the response.

I suspected that it was a terminal command, however, I am not too familiar with that as well. I have tried several combinations and have attached a screen shot. Maybe it is my execution of the command? Any comments?


I tired a few more combinations and realized that the command was executed initially. However it doesn’t solve my problem. See screenshot below.


I think that first line worked. (Unix commands, like dscacheutil, are notorious for silent success.) Have you tried building since?


Yes, I have tired, still the same issue of local host. This issue comes up with all three builds I’ve made including the Challenge one at end of Chapter 3. They all get the build succeeded then could not launch feedback.


I have found the solution to my problem. My host file was saved as a .rtf format instead of .txt. A quick change and problem solved.