Update: Don't use ".dev". When this was originally posted in 2016, it was fine. Now it's not. Start by changing your TLD to somethinge else like ".localhost" or whatever. (This change would not have fixed my issue, but it might fix yours if you're still using ".dev").
Problem: I've installed Laravel Valet and it all seems to be working except when I ping test.dev (which just contains an index.htm file and is located in ~/Sites), after hanging for a long time I get the response ping: cannot resolve test.dev: Unknown host
Here's what I've already done:
- I've gone through the Laravel Valet docs and everything installed fine.
- Apache is not running
/etc/hostscontains no mention oftest.dev- I'm on valet v1.1.12
- I've restarted my computer
- I've installed php 7.0.7 via homebrew fresh and
--with-fpm - My
$PATHcontains$PATH:$HOME/.composer/vendor/bin sudo lsof -n -i:80 | grep LISTENreturns thecaddyprocbrew services listreturnsdnsmasqand is started- I've updated brew, run
brew doctorand all is good there - I can start and stop valet successfully.
valet pathsreturns successfully:[ "/Users/nateritter/.valet/Sites", "/Users/nateritter/Sites" ]- Using
valet linkinside thetestdirectory has no effect on this issue
Now, in addition to all this, I decided to try all the valet arguments out. valet share seemed to bork with an error at one point, which is interesting but I'm not sure it has anything to do with the original issue.
ERROR: Tunnel 'command_line' specifies invalid address 'test.dev:80': unexpected '[' in address test.dev:80
After this I get 21 lines of Failed to connect to 127.0.0.1 port 4040: Connection refused and then an exception:
[Httpful\Exception\ConnectionErrorException]
Unable to connect to "http://127.0.0.1:4040/api/tunnels": 7 Failed to connect to 127.0.0.1 port 4040: Connection refused
fetch-share-url