valet: Cannot Ping .test sites / DnsMasq Issues
Clear description of your problem
Dnsmasq is showing errors causing sites not to load. Post brew python upgrade PHP somehow got upgraded to PHP 8 and though I did valet use php@7.4
it stopped working. But I do not think these two are related. I normally only work with Laravel Valet and only run other Nginx instances in Docker using Minikube so there should be no issues really.
brew services list
Name Status User Plist
dnsmasq error jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
httpd started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.httpd.plist
mariadb started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx error jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php error jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.php.plist
php@7.4 started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.php@7.4.plist
redis started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.redis.plist
and services check as sudo
sudo brew services list
Name Status User Plist
dnsmasq started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
httpd started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.httpd.plist
mariadb started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.php.plist
php@7.4 started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.php@7.4.plist
redis started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.redis.plist
ping check
ping smtv.test
ping: cannot resolve smtv.test: Unknown host
I can no longer load .test sites running on Laravel Valet. I did do composer global update
and valet install
twice and tried to brew services restart dnsmasq but it seems DNS won’t run so pinging sites does not work.
Expected behavior
I expect sites to run and load as before.
Current behavior
Steps to Reproduce
- start laravel valet and try to run any website
- get unknown host warning
- get site failing to load.
Output of these steps
Possible solution
Get dnsmasq to run properly again would be needed. But not sure yet how.
Diagnosis
<details>
<summary>sw_vers</summary>
<pre>ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H114</pre>
</details>
<details>
<summary>valet --version</summary>
<pre>Laravel Valet 2.13.16</pre>
</details>
<details>
<summary>cat ~/.config/valet/config.json</summary>
<pre>{
"tld": "test",
"paths": [
"/Users/jasper/.config/valet/Sites"
]
}</pre>
</details>
<details>
<summary>cat ~/.composer/composer.json</summary>
<pre>{
"require": {
"laravel/valet": "^2.8",
"squizlabs/php_codesniffer": "*",
"laravel/installer": "^2.1",
"deployer/deployer": "^5.0"
}
}</pre>
</details>
<details>
<summary>composer global diagnose</summary>
<pre>Changed current directory to /Users/jasper/.composer
Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
require.squizlabs/php_codesniffer : unbound version constraints (*) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: You are not running the latest stable version, run `composer self-update` to update (2.0.5 => 2.0.8)
Composer version: 2.0.5
PHP version: 7.4.13
PHP binary path: /usr/local/Cellar/php@7.4/7.4.13_1/bin/php
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
cURL version: 7.74.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/1.1.1i
zip extension: OK</pre>
</details>
<details>
<summary>composer global outdated</summary>
<pre>Changed current directory to /Users/jasper/.composer
deployer/deployer v5.1.3 ~ v6.8.0 Deployment Tool
deployer/phar-update v2.2.0 = v2.2.0 Integrates Phar Update to Symfony Console.
Package deployer/phar-update is abandoned, you should avoid using it. No replacement was suggested.
guzzlehttp/guzzle 6.5.5 ~ 7.2.0 Guzzle is a PHP HTTP client library
laravel/installer v2.3.0 ~ v4.1.1 Laravel application installer.
symfony/console v3.4.47 ~ v5.2.0 Symfony Console Component
symfony/filesystem v4.4.17 ~ v5.2.0 Symfony Filesystem Component
symfony/finder v3.4.47 ~ v5.2.0 Symfony Finder Component
symfony/process v3.4.47 ~ v5.2.0 Symfony Process Component
symfony/var-dumper v4.4.17 ~ v5.2.0 Symfony mechanism for exploring and dumping PHP variables
symfony/yaml v3.4.47 ~ v5.2.0 Symfony Yaml Component</pre>
</details>
<details>
<summary>ls -al /etc/sudoers.d/</summary>
<pre>total 16
drwxr-xr-x 4 root wheel 128 Dec 16 07:02 .
drwxr-xr-x 123 root wheel 3936 Dec 16 13:28 ..
-rw-r--r-- 1 root wheel 80 Oct 2 2019 brew
-rw-r--r-- 1 root wheel 83 Oct 2 2019 valet</pre>
</details>
<details>
<summary>brew config</summary>
<pre>HOMEBREW_VERSION: 2.6.2-74-gf070c35
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: f070c35d287cd5f3fd52dbbc7d6646fd24d8cc11
Last commit: 11 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c93214fd175f35353de254f21cfda0ee49858a37
Core tap last commit: 4 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.tnwsfIhN5K/org.macosforge.xquartz:0
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit ivybridge
Clang: 12.0 build 1200
Git: 2.21.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_121, 1.8.0_25
macOS: 10.15.7-x86_64
CLT: 12.0.32.2
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11</pre>
</details>
<details>
<summary>brew services list</summary>
<pre>Name Status User Plist
dnsmasq error jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
httpd started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.httpd.plist
mariadb started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx error jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php error jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.php.plist
php@7.4 started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.php@7.4.plist
redis started jasper /Users/jasper/Library/LaunchAgents/homebrew.mxcl.redis.plist</pre>
</details>
<details>
<summary>brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"</summary>
<pre>dnsmasq 2.82
mariadb 10.5.8
nginx 1.19.5
openssl@1.0 1.0.2t
openssl@1.1 1.1.1h 1.1.1i
php 8.0.0_1 7.4.9 7.4.2
php@7.4 7.4.13_1</pre>
</details>
<details>
<summary>brew outdated</summary>
<pre>adns
automake
boost
clamav
cmake
coreutils
css-crush
fping
freerdp
git
gnupg
gnutls
go
go-bindata
helm
heroku/brew/heroku
heroku/brew/heroku-node
iproute2mac
jpegoptim
json-c
kubernetes-cli
libassuan
libgcrypt
libgpg-error
libksba
libtasn1
libusb
libxml2
libyaml
nettle
node@10
npth
nvm
openjdk
optipng
p11-kit
pinentry
pngcrush
protobuf
protobuf-c
redis
spdylay
sqlmap
telnet
terraform
tree
wget
yuicompressor
gisto
sequel-ace</pre>
</details>
<details>
<summary>brew tap</summary>
<pre>bradp/vv
hashicorp/tap
heroku/brew
homebrew/cask
homebrew/core
homebrew/services
rbenv/tap
shivammathur/php</pre>
</details>
<details>
<summary>php -v</summary>
<pre>PHP 7.4.13 (cli) (built: Nov 30 2020 14:46:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies</pre>
</details>
<details>
<summary>which -a php</summary>
<pre>/usr/local/bin/php
/usr/bin/php</pre>
</details>
<details>
<summary>php --ini</summary>
<pre>Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File: /usr/local/etc/php/7.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.4/conf.d/error_log.ini,
/usr/local/etc/php/7.4/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini</pre>
</details>
<details>
<summary>nginx -v</summary>
<pre>nginx version: nginx/1.19.5</pre>
</details>
<details>
<summary>curl --version</summary>
<pre>curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets</pre>
</details>
<details>
<summary>php --ri curl</summary>
<pre>curl
cURL support => enabled
cURL Information => 7.74.0
Age => 7
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => Yes
BROTLI => Yes
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin19.6.0
SSL Version => (SecureTransport) OpenSSL/1.1.1i
ZLib Version => 1.2.11
libSSH Version => libssh2/1.9.0
Directive => Local Value => Master Value
curl.cainfo => no value => no value</pre>
</details>
<details>
<summary>~/.composer/vendor/laravel/valet/bin/ngrok version</summary>
<pre>ngrok version 2.3.35</pre>
</details>
<details>
<summary>ls -al ~/.ngrok2</summary>
<pre>ls: /Users/jasper/.ngrok2: No such file or directory</pre>
</details>
<details>
<summary>brew info nginx</summary>
<pre>nginx: stable 1.19.5 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.19.5 (25 files, 2.2MB) *
Poured from bottle on 2020-11-30 at 17:57:06
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nginx.rb
License: BSD-2-Clause
==> Dependencies
Required: openssl@1.1, pcre
==> Options
--HEAD
Install HEAD version
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx
==> Analytics
install: 46,355 (30 days), 130,615 (90 days), 447,583 (365 days)
install-on-request: 45,962 (30 days), 128,775 (90 days), 436,473 (365 days)
build-error: 0 (30 days)</pre>
</details>
<details>
<summary>brew info php</summary>
<pre>php: stable 8.0.0 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/php/7.4.2 (515 files, 76.0MB)
Built from source
/usr/local/Cellar/php/7.4.9 (497 files, 72.2MB)
Poured from bottle on 2020-09-01 at 12:41:08
/usr/local/Cellar/php/8.0.0_1 (499 files, 77.8MB)
Poured from bottle on 2020-12-17 at 09:05:33
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/php.rb
License: PHP-3.01
==> Dependencies
Build: httpd, pkg-config
Required: apr, apr-util, argon2, aspell, autoconf, curl, freetds, gd, gettext, glib, gmp, icu4c, krb5, libffi, libpq, libsodium, libzip, oniguruma, openldap, openssl@1.1, pcre2, sqlite, tidy-html5, unixodbc
==> Options
--HEAD
Install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/8.0/
To have launchd start php now and restart at login:
brew services start php
Or, if you don't want/need a background service you can just run:
php-fpm
==> Analytics
install: 65,342 (30 days), 171,176 (90 days), 602,255 (365 days)
install-on-request: 63,924 (30 days), 167,779 (90 days), 576,587 (365 days)
build-error: 0 (30 days)</pre>
</details>
<details>
<summary>brew info openssl</summary>
<pre>openssl@1.1: stable 1.1.1i (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/openssl@1.1/1.1.1h (8,067 files, 18.5MB)
Poured from bottle on 2020-11-03 at 09:38:04
/usr/local/Cellar/openssl@1.1/1.1.1i (8,067 files, 18.5MB)
Poured from bottle on 2020-12-17 at 09:01:36
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs
and run
/usr/local/opt/openssl@1.1/bin/c_rehash
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
For pkg-config to find openssl@1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
==> Analytics
install: 836,731 (30 days), 2,248,902 (90 days), 7,675,606 (365 days)
install-on-request: 131,547 (30 days), 347,245 (90 days), 1,094,750 (365 days)
build-error: 0 (30 days)</pre>
</details>
<details>
<summary>openssl version -a</summary>
<pre>LibreSSL 2.8.3
built on: date not available
platform: information not available
options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)
compiler: information not available
OPENSSLDIR: "/private/etc/ssl"</pre>
</details>
<details>
<summary>openssl ciphers</summary>
<pre>ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:GOST2012256-GOST89-GOST89:DHE-RSA-CAMELLIA256-SHA256:DHE-RSA-CAMELLIA256-SHA:GOST2001-GOST89-GOST89:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:CAMELLIA256-SHA256:CAMELLIA256-SHA:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA256:DHE-RSA-CAMELLIA128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:CAMELLIA128-SHA256:CAMELLIA128-SHA:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:RC4-SHA:RC4-MD5:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA</pre>
</details>
<details>
<summary>sudo nginx -t</summary>
<pre>nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful</pre>
</details>
<details>
<summary>which -a php-fpm</summary>
<pre>/usr/local/sbin/php-fpm
/usr/sbin/php-fpm
/usr/local/sbin/php-fpm</pre>
</details>
<details>
<summary>/usr/local/opt/php/sbin/php-fpm -v</summary>
<pre>PHP 8.0.0 (fpm-fcgi) (built: Nov 30 2020 13:47:39)
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies</pre>
</details>
<details>
<summary>sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/7.4/php-fpm.conf --test</summary>
<pre>[17-Dec-2020 09:36:46] NOTICE: configuration file /usr/local/etc/php/7.4/php-fpm.conf test is successful</pre>
</details>
<details>
<summary>ls -al ~/Library/LaunchAgents | grep homebrew</summary>
<pre>-rw-r--r-- 1 jasper staff 657 Dec 17 09:34 homebrew.mxcl.dnsmasq.plist
-rw-r--r-- 1 jasper staff 447 Dec 17 09:34 homebrew.mxcl.httpd.plist
-rw-r--r-- 1 jasper staff 541 Dec 17 09:34 homebrew.mxcl.mariadb.plist
-rw-r--r-- 1 jasper staff 571 Dec 17 09:34 homebrew.mxcl.nginx.plist
-rw-r--r-- 1 jasper staff 628 Dec 17 09:34 homebrew.mxcl.php.plist
-rw-r--r-- 1 jasper staff 636 Dec 17 09:34 homebrew.mxcl.php@7.4.plist
-rw-r--r-- 1 jasper staff 823 Dec 17 09:34 homebrew.mxcl.redis.plist</pre>
</details>
<details>
<summary>ls -al /Library/LaunchAgents | grep homebrew</summary>
<pre></pre>
</details>
<details>
<summary>ls -al /Library/LaunchDaemons | grep homebrew</summary>
<pre></pre>
</details>
<details>
<summary>ls -aln /etc/resolv.conf</summary>
<pre>lrwxr-xr-x 1 0 0 22 Nov 7 2019 /etc/resolv.conf -> ../var/run/resolv.conf</pre>
</details>
<details>
<summary>cat /etc/resolv.conf</summary>
<pre>#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
# scutil --dns
#
# SEE ALSO
# dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
nameserver 8.8.8.8
nameserver 8.8.4.4</pre>
</details>
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (11 by maintainers)
You were right to stop running all those brew services as
jasper
instead of as root. Valet wants them running as root (And dnsmasq must run as root or it can’t deal with port 53 properly), and will do that when you runvalet start
or other commands that stop/restart services. Tip: for nginx, php, dnsmasq, use sudo to stop/start, or let Valet do it with Valet commands. For other services, you may not need sudo.