Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JanneVos's avatar

Laravel Valet ping doesn't return 127.0.0.1

I'm trying to install Valet on a new MacBook. When trying to install Valet everything seems fine, except the pages wouldn't load.

In the Laravel documentations they state: "Once Valet is installed, try pinging any *.test domain on your terminal using a command such as ping foobar.test. If Valet is installed correctly you should see this domain responding on 127.0.0.1." My response is "PING foobar.test (198.18.2.3)"

I have tried doing fresh installs of Valet, Dnsmasq and Nginx and tried different dnsmasq.conf configurations, but nothing seems to help.

Any ideas?

0 likes
25 replies
JanneVos's avatar

After some debugging, I think this is a Dnsmasq problem. When I add the foobar.test domain in my hosts file, my ping response is 127.0.0.1. Weirdly my settings are the same as my old MacBook, but with my old MacBook everything works just fine.

JanneVos's avatar

@Tray2 thank you for your reply. I have used Valet on my other Macbook for over a year. I have used the park command and the link command. When I use valet parked or valet links, the sites show up. But when I ping those domains the response is still 198.18.2.3

JanneVos's avatar

@Tray2 But when I use ping on a test domain made with Valet, it should return ip dress 127.0.0.1 right?

Tray2's avatar

@JanneVos Never tested it, but ping sends a request out and it gets routed to the machines public ip. Same if you do a ping to your computers hostname

ping <hostname> it returns the public ip.

If you do ping localhost then you will get the home address (:::1 or 127.0.0.1)

JanneVos's avatar

@Tray2 in the Laravel documentation it states that if you install Valet correctly and ping foobar.test you should return ip 127.0.0.1. But if we ignore this. Why isn't Valet working? Projects only showing up when I add the domain to de host file?

JanneVos's avatar

@Tray2 Already did this like four times.

I have removed php, nginx, dnsmasq, valet. Reinstalled php and did new Valet install. I have removed everything again. Installing nginx and dnsmasq before new Valet install. I have tried many different dnsmasq configurations.

Tray2's avatar

@JanneVos I know that I had similar issues, I ended up installing those manully and then installed valet. There should be a thread about it somewhere in the forum.

Tray2's avatar

@JanneVos I tried pinging one of my projects and it showed localhost or 127.0.0.1.

My guess is that your dnsmasq isn't properly installed or configured.

SudiptaLeonid's avatar

I am having the same issue with Apple M1 Silicon. Tried multiple times uninstalling everything and reinstalling it but no luck, previously valet was working fine with Apple Intel Silicon.

Sites are not opening and when trying to ping it returning 198.18.2.*

But when I am adding the site in /etc/hosts like "127.0.0.1 foobar.test" it starts running and also returning 12.0.0.1 on ping. But I think valet should work without adding sites under hosts. Please help if anyone has a solution.

chunterb's avatar

Would you happen to have FortiClient installed on this machine by any chance?

1 like
jzelez's avatar

@chunterb Thanks for this! I was going nuts with this issue until I saw your comment. I have nothing to do with PHP nor Valet, but had the same issue with dnsmasq. Thanks again for pointing me to a right direction.

oneeyebrow's avatar

@jzelez Were you able to find solution getting this to work with ForitClient. Just had the issue come up the other day. Thanks.

Dazzo716's avatar

@JanneVos Did you just manually edit it to add each individual site? or is there a way to make all .test subdomains resolve?

Please or to participate in this conversation.