Valet (Laravel): DNS address can not be found - laravel

I'm trying out Valet, it looks really nice from what I've heard.
I've been trough the "whole" installation process, Valet is succesfully installed.
But when I cd into my projects file and enter valet park and browse to http://blog.dev, I get "The DNS server address of blog.dev can not be found."
I have no idea what I'm doing wrong. :)

When you run valet install it attempts to install dnsmasq. It requires sudo privileges.
You can check that it's installed and running using
brew services list
You should see something like
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
You may however need to tap brew/services first
brew tap homebrew/services
If it's not there, run
brew install dnsmasq
brew services start dnsmasq
Run valet install again to set up dnsmasq and keep an eye out for any errors. What this should do is append a line to the bottom of /usr/local/etc/dnsmasq.conf similar to
conf-file=/Users/{YOURUSER}/.valet/dnsmasq.conf
/Users/{YOURUSER}/.valet/dnsmasq.conf then should contain
address=/.dev/127.0.0.1
Check that your dns server is responding to requests
dig testing.dev #127.0.0.1
You should see a response like
;; ANSWER SECTION:
testing.dev. 0 IN A 127.0.0.1
To actually ensure that your Mac knows that it should resolve *.dev using your local DNS server, it need to be told to do so. Valet also handles this for you but you can check if it's done it's job by doing the following.
Inside the directory /etc/resolver, there should be a file entitled dev with the following contents
nameserver 127.0.0.1
This creates a custom DNS resolver for *.dev and points all requests at your local DNS server.
Restart dnsmasq with either of the following commands and then give it a try again.
// this
brew services restart dnsmasq
// or this
sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq
If this is all working, you should be able to ping anything.dev
ping anything.dev
PING anything.dev (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.081 ms
That ensures the DNS related bits are working.
Ultimately the question is about DNS related problems but as this started off as a here's everything you need to have tried, I'll leave this below. That said, if you're unable to ping something.dev or get an error like "The DNS server address of blog.dev can not be found." as per the OP, it's something above to do with DNS which needs resolving.
Since Caddy serves websites on port 80, you need to ensure that nothing else is running on port 80.
sudo lsof -n -i:80 | grep LISTEN
Ideally this should return caddy if valet is running as expected. You want to see the example below or nothing ideally; nothing because it means we can just start Valet.
caddy 76234 root 3u IPv6 0x4f871f962e84fa95 0t0 TCP *:http (LISTEN)
You may see other webservers, such as Apache or Nginx (and their child processes, _www and nobody) in the example below.
httpd 79 root 4u IPv6 0xf4641199930063c5 0t0 TCP *:http (LISTEN)
httpd 239 _www 4u IPv6 0xf4641199930063c5 0t0 TCP *:http (LISTEN)
nginx 4837 root 6u IPv4 0xf4641199a4e8e915 0t0 TCP 127.0.0.1:http (LISTEN)
nginx 4838 nobody 6u IPv4 0xf4641199a4e8e915 0t0 TCP 127.0.0.1:http (LISTEN)
Assuming you've installed Nginx with homebrew you can run the following to stop it.
brew services stop nginx
OSX ships with Apache installed so you can stop with with the following if it's running.
sudo apachectl stop
At this point you can likely start Valet with valet start and it'll work.
You may get a further error which is caused by PHP being installed without FPM. You can check this using
brew info php70 | grep php70-fpm
Which should yield something along the lines of
The control script is located at /usr/local/opt/php70/sbin/php70-fpm
If it doesn't appear to be installed, use the following.
brew uninstall homebrew/php/php70
brew install homebrew/php/php70 --with-fpm
valet restart

I had the same problem - getting stuck at ping foobar.dev - and fixed it by restarting my Macbook (after valet install). I am sure this is not an exact solution and I reckon there is a way to do this without restarting. Yet, it worked for me. I did not have to do any other steps.
[Edit - Additionally, before restarting I made sure to try the installing with fpm tip, and to follow all brew's suggestions upon installing php70 (tweaking the path, making sure php70 starts on system start. I cannot say whether these things helped, so probably want to try just restarting, first. If it's really just a restart that's required, or some other additional step to properly start services, I think the laravel documentation probably needs some clarification.]

I had the same problem, post installation I got stuck at pinging foo.dev.
I checked for running services.
> brew services list
Name Status User Plist
dnsmasq stopped
nginx stopped
php71 stopped
Started all the three services manually with
> brew services start dnsmasq
> brew services start nginx
> brew services start php71
Ran valet install.
Ping successfully to foo.dev

If you are a Windows user,
Perform the Acrylic Configuration then restart your adapter(Disable and Enable)
http://mayakron.altervista.org/wikibase/show.php?id=AcrylicWindows10Configuration
Worked For Me

Related

Sesman-Xvnc throws password failed with every user

I have an Ubuntu 16.04 LTS virtual machine that I use for log management. Since I created it, I use Sesman-Xvnc and has always been nice and easy to log in. However, after been on it for the last 3 weeks with on issues whatsoever, today I got to the office and it throws this error:
Connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to session manager, please wait...
xrdp_mm_process_login_response: login successful for display
Started connecting
connecting to 127.0.0.1 5912
tcp connected
security level is 2 (1 = none, 2 = standard)
password failed
error - problem connecting
I didn't changed my password, the machine was on all the time and I am able to log in via ssh with my user and password.
I have tried reinstalling the services with:
sudo apt-get remove xrdp vnc4server tightvncserver
sudo apt-get install tightvncserver
sudo apt-get install xrdp
And then restarted the xrdp service with:
service xrdp restart
I have also created a new user but the results are the same; password failed.
Any ideas of how to sort this out?
Thank you very much familia. ;)
I too have the same issue facing it since today, Have put up the issue here.
XRDP doesnt connect to Azure VM suddenly
I fixed it by allowing the port which it is trying to connect to sesman in the ufw:
The moment u see connecting to "sesman ip 127.0.0.1 port 3350" (or any other port) in the RDP, Take that port number, and allow that port to the ufw using
These are the steps I used :
Downgrade ur xrdp using this :
[sudo apt-get install xrdp=0.6.1-2
and Hold the xrdp instance,
sudo apt-mark hold xrdp
Sudo ufw enable
Sudo ufw allow 3350 and
Sudo ufw allow 3389]
NB:You may use this cmd to see if its open:
sudo netstat -plnt | grep rdp
Perform these in the SSH window.
This worked for me. Hope it fixes this issue.
We had the same issue and it seems to be caused by an automatic update of 'xrdp'. Have a look to this post:
https://askubuntu.com/questions/1108550/xrdp-failed-problem-connecting-when-package-was-auto-updated

Using dnsmasq with wildcard on Mac

I'd like to point all *.test domains to my Laravel Homestead machine on 192.168.10.10. I used to have it working with *.dev domains, but after new *.dev policy implemented by Chrome 63, I prefer to change it to *.test.
I fail to understand how local DNS works, as it seems to use trillion different configs and caches. What I did is:
Making sure 192.168.10.10 with HTTP Host set to me.test works. It works.
In /usr/local/etc/dnsmasq.conf, I do have an entry address=/.test/192.168.10.10 (I also tried with 127.0.0.1)
In /etc/resolver/test file, I put nameserver 127.0.0.1 - it used to work this way with /etc/resolver/dev. I still don't understand why it's 127.0.0.1 and not 192.168.10.10. I tried both anyway.
Clearing DNS cache with sudo killall -HUP mDNSResponder; sudo killall mDNSResponderHelper; sudo dscacheutil -flushcache
Restarting dnsmasq with sudo launchctl stop homebrew.mxcl.dnsmasq; sudo launchctl start homebrew.mxcl.dnsmasq.
Trying to visit http://me.test/.
It doesn't work. The domain will take forever to be loaded and nothing happens.
What am I doing wrong?
My OS is High Sierra, dnsmasq installed via homebrew.
I don't use dnsmasq, but I believe you want to edit /usr/local/etc/dnsmasq.conf and have listen-address=127.0.0.1 set so dnsmasq is listening on that IP, but have address=/.test/192.168.10.10 so that .test is routed to 192.168.10.10.
Then make sure System Preferences -> Advanced you have 127.0.0.1 as the first DNS server entry for your connection.
Make sure you're restarting dnsmasq every time you edit the configuration file.

Postgres on a Mac

I am trying to run Postgres on a mac OS 10.10.5.
I installed via Homebrew. I had previously installed by just downloading from the web at some point but I want to use Homebrew across the board so I moved the original to the trash.
I run
brew services start postgres
That works fine. I now see postgres in my activity monitor and can run
sudo lsof -i -n -P | grep TCP
to see
postgres 807 username 5u IPv6 0x3ba11f77231b4ebb 0t0 TCP [::1]:5432 (LISTEN)
postgres 807 username 6u IPv4 0x3ba11f772808980b 0t0 TCP 127.0.0.1:5432 (LISTEN)
I am trying to add a DB and some tables but when I run postgres I get
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
I removed the following line from my bash_profile
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
I restarted the terminal and when I run which postgres I see it is pointing to
/usr/local/bin/postgres
I don't know how to interact with postgres or get the envoirment fixed up.
Any help would be greatly appreciated!

Killing an unknown self restarting server on port 80 Mac OSX

I have a server running on port 80, but I do not know what it is or where it came from. When I run
sudo lsof -i :80 | grep LISTEN
I get
httpd 80 root 5u IPv6 0x91f5a9de62859cfd 0t0 TCP *:http (LISTEN)
httpd 694 _www 5u IPv6 0x91f5a9de62859cfd 0t0 TCP *:http (LISTEN)
I have tried to enter get the process name using the PID, but all I ever get in return is "httpd" or "FOREGROUND".
When I kill the PID, the process simply restarts with a new PID. I assume I will have to stop it at launch.
How can I stop this server from running at startup?
If it helps any, I am trying to free up port 80 to use the apache server on MAMP.
This is just a guess, but it might be the built-in version of apache, being launched (& restarted) by launchd (OS X's daemon manager). It's disabled by default, but might've gotten enabled somehow. You can try disabling it with:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
If that doesn't do it (it'll say something like "Could not find specified service"), you can check to see if it's some other launch daemon item by looking for the PID of the master process (the one running as root, not _www):
sudo launchctl list | grep <masterPID>
That won't necessarily tell you exactly what's going on, but might point you in the right direction.
Like Gordon suggested, that's the built-in version of the Apache web server.
You can stop it with
sudo apachectl stop
btw, the configuration for this webserver can be found in the /etc/apache2/httpd.conf directory.
This happens to me a lot.
As #Gordon Davisson explains it is most likely the launchdeamon process conflicting with the service you have set up.
Definitely stop the apachetl server.
sudo apachetl -k stop
Try to find all the httpd process, they should be the last ones
sudo lsof -i :80 // without grep
Then get the first process (most likely in the 1000s) should also be the lowest one.
sudo kill <firstHttpdPID>
This should kill ALL the processes running that httpd instance and then you get simply start back up your server.
Must stop it first though or it will continue running again.
Mac OSX comes bundled with Apache, however it is deactivated. You might have activated it somehow. In my case, I have previously install XAMPP and configured something in the /etc/apache2/httpd.conf that leads my port localhost:80 to leads to html page with It Works!.
TLDR, the solution is to deactivate the Apache2 server.
Go to your terminal, and type this
sudo apachetl -k stop
In my case, it returns the following:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Shafies-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message
httpd (no pid file) not running
if you typed localhost on your browser, the port 80 is not active anymore and you will not see It Works! anymore.
For context, I have deleted XAMPP long time ago and not aware that my localhost:80 is still active. I am not able redirect dummy domain -- posts.com to my localhost port for my kubernetes YAML config files.
This is my ingress-srv.yaml file:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-srv
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
rules:
- host: posts.com
http:
paths:
- path: /?(.*)
backend:
serviceName: client-srv
servicePort: 3000
and I have tricked the operating system to redirect my posts.com to localhost:80 by adding below line in the hosts file located at /etc/hosts
127.0.0.1 posts.com
by SM

The port 80 in Mac is used

We have to use port 80 for our server. But when I was trying to use it in Mac, it always said that the 80 is used, but I don't know which program uses it.
I searched it in Google, and someone said it's about apache, but I tried, which is not working. I found this: https://gist.github.com/kujohn/7209628 , but seems it's not working visiting our server by IP address.
I really don't know what's going on and how can I find out which program using port 80 and stop it.
Many thanks if anyone can help, I'm new using Mac. Thanks.
To find out what process is using port 80
go to Applications
open utilities.
open Activity Monitor.
click on the Memory tab,
look at the ports and the processes using them. Find port 80 and select it
go to the view on the menu bar and choose Quit process.
This will just kill the process, it will not stop a server instance that is already running from continuing to run.
(Correction: the Ports column shows the number of open ports (and files?), not the port number)
It is not clear if you are using a database management system or not and which one but one method that has worked for me using MAMP is as follows.
stop the server by using sudo apachectl stop command.
then change the port to port 80.
then restart your servers.
type the following in Terminal
sudo lsof -i -n -P | grep TCP
you will get a list - e.g. dropbox listens on 80
you can copy the output to a text editor, etc to search
On Mac ports below 1024 can only be bound by the root user.
Try launching your server as root user (with sudo), or try to use a port above 1024.
You can also try to add root permissions to your user in /etc/sudoers
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
your_user_here ALL = (ALL) ALL
I was having this issue, apache was disabled via launchctl, but was still tying up port 80 after launch, I could start up apache and it would work, but after unloading it, I couldn't start up anything on port 80. I was using the built in web server for Python as an easy test. It would work on port 81, but not on port 80.
sudo python -m SimpleHTTPServer 80 -- wouldn't work
sudo python -m SimpleHTTPServer 81 -- would work
Here are the symptoms:
$ launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
$ sudo lsof -i ':80'
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Python 3353 root 3u IPv4 0xe455777a82799f05 0t0 TCP *:http (LISTEN)
The fix for me (after way too much searching) was simple:
sudo pfctl -F all
This flushed the packet filter, releasing port 80 (and others I assume 8080, 443, whatever ports apache might be tying up)
After that, and relaunching the python server, it came right up.
Might be Skype that is using port 80. If you have Skype installed and running try to change to a different port in the settings.
Port numbers in the range from 0 to 1023 are classified as 'well-known' and port number 80 is reserved for HTTP. Typically you have servers listening on port 80 to handle HTTP requests.
Source:
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

Resources