-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically check/set DNS settings? #775
Comments
I like the possibility of automating this. The wrinkle is that I've seen Valet run on numerous machines without ever having to set any DNS entries in the Mac ... which is cleaner. Granted, that isn't always "better". This is an opinionated tool, so being opinionated about this step may simplify usage (and support) even more. Question: Is the change just as easily undone (removed)? Structurally I'd put the code for it with the other Dnsmasq stuff, and then call it from there. |
Hi, Thanks for the prompt reply.
Anecdotal, but in my case the problem was I had set custom DNS servers (Cloudflare's) and the problem was only noticeable when making curl requests from a PHP script to a valet domain. If I remove the custom DNS servers it works, and if I use I imagine a lot of user's don't both have custom DNS servers and are making curl requests between Valet sites. I personally only noticed the issue because I was testing OAuth flows. I think Valet would only need to add the dns server if
So you can remove the 127.0.0.1 entry. For the example above you would remove it like this: networksetup -setdnsservers 'Wi-fi' 1.1.1.1 1.0.0.1 The problem is we would have to remember if they already had the I don't know very much about DNS, is there a downside to leaving the What if we check if
That sounds good to me 👍 |
Yes -- if it's listed as a server to check, and if nothing gives a hard fail/deny then it'll wait for a timeout before moving on to the next one in the list. I wonder if there's a "simple" way to detect whether there's actually a DNS service responding on 127.0.0.1 and only add/remove if not? That might be more idempotent than logging and asking the user a question they may not know how to answer. |
It looks like we might be able to do this with $ dig +short +time=2 @127.0.0.1 TXT CHAOS version.bind
"dnsmasq-2.80" When dnsmasq is not running: $ dig +short +time=2 @127.0.0.1 TXT CHAOS version.bind
;; connection timed out; no servers could be reached |
That's promising! |
Hi there, we're cleaning up the Valet issue tracker and are moving all feature requests/support questions to the Discussions tab. We'll be using the issue tracker solely for bugs with Valet from now on. You're welcome to continue the discussion on in the Discussions tab. Thanks! |
There have been a few issues caused by 127.0.0.1 missing from the DNS servers:
What if we could make Valet check if the local DNS server is setup and either show a warning with instructions to fix it or fix it automatically?
It looks like this is possible with the
networksetup
utility, i.e.Any interest in doing this? If so I would be willing to put together a PR.
The text was updated successfully, but these errors were encountered: