I have clean Docksal after installing on clean Debian Stretch.
I forced to add my host to /etc/hosts, because there is "Server DNS address could not be found” without it.
It is not the big problem for me, but some service host does not work in Behat testing (Selenium, Browser?) and I still cannot recognize what DNS Behat needs.
How to befriends Docksal and Debian concerning the automatic recognition of all DNS.
@ArtuGit I do not fully understand your situation. This may be something that you could easier get interactive help with on the Docksal gitter chat.
On Ubuntu I see the DNS server in the Docksal container listed in:
/etc/resolv.conf
where I see the line:
nameserver 192.168.64.100
This is the IP address that Docksal is configured to use for Docker.
This is added by Docksal. This is the first thing I would check.
Docksal does not edit resolv.conf directly. A network interface for 192.168.64.1/24 subnet with nameserver 192.168.64.100 is being added. Linux handles the rest. However network handling differs from repo to repo, so on Debian (especially older ones) it might not work.
Could be related to #321
Adding nameserver 192.168.64.100 as the first line into /etc/resolv.conf solves the problem with accessibility *.docksal hosts.
But I still have the problem:
fin reset dns
WARNING: No swap limit support
Resetting Docksal DNS service and configuring resolver for .docksal domain...
Enabling automatic *.docksal DNS resolver...
ERROR: The upstream DNS server (8.8.8.8) is not reachable.
You are either offline, 8.8.8.8 is not a valid DNS server or DNS requests to 8.8.8.8 are blocked.
Once the current operation completes, follow the steps below:
1. Open ~/.docksal/docksal.env and set DOCKSAL_DNS_UPSTREAM to your local network DNS server
2. Run fin reset dns to see if it works
Is it related to this issue?
@ArtuGit I believe /etc/resolv.conf should not be altered manually - https://wiki.debian.org/resolv.conf. That's why we have #321, however, I don't know whether that will work with other Debian flavors (including pure Debian) other than Ubuntu.
Regarding the upstream DNS server issues - what do you get from
nslookup google.com
nslookup google.com 8.8.8.8
Lots of developers disable resolvconf's management of resolv.conf . I can't speak for other distros, but in Ubuntu it's often a casualty of disabling systemd-resolved, which blocks up port 53 and generally makes life miserable for web devs. I think that's a more complicated issue than we really want to get into, though.
I just submitted a PR for using nmcli to setup the nameserver. Hopefully that will be enough for most use cases.
Thank you for the answers.
I understand that is important this issue correctly, the following solution helps me -
https://askubuntu.com/questions/157154/how-do-i-include-lines-in-resolv-conf-that-wont-get-lost-on-reboot (first answer).
I installed resolvconf.
@achekulaev
artu@desktop:/$ nslookup google.com
Server: 192.168.64.100
Address: 192.168.64.100#53
Non-authoritative answer:
Name: google.com
Address: 216.58.209.78
artu@desktop:$ nslookup google.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: google.com
Address: 216.58.209.78
Can it help?
@ArtuGit Have you tried the instructions in the error message?
- Open ~/.docksal/docksal.env and set DOCKSAL_DNS_UPSTREAM to your local network DNS server
- Run fin reset dns to see if it works
If you are running dnsmasq on your computer then you can add 127.0.0.1 or 127.0.1.1 as the IP address in **~/.docksal/docksal.env
DOCKSAL_DNS_UPSTREAM=127.0.0.1
You can check if your computer is resolving DNS one of those ip addresses with:
dig google.com @127.0.0.1 or dig google.com @ 127.0.1.1 if you get an IP address back in response that IP address will work if you get back the "no servers could be reached" message then it will not work.
If you computer is not running a DNS that will resolve addresses you can add your local network DNS server IP address, normally on a small network the router will also do this, but if you move your computer to another network this may break as the router address could be different.
@ArtuGit Not sure if it would help you but here are good instructions on setting up dnsmasq for Ubuntu. https://help.ubuntu.com/community/Dnsmasq
Thank you @frederickjh, I tried DOCKSAL_DNS_UPSTREAM=127.0.0.1 without success,
but you gave me an idea: DOCKSAL_DNS_UPSTREAM=192.168.1.1 work for me.
It is my router address.
@ArtuGit the test below means that you are able to make DNS requests to 8.8.8.8 (Google Public DNS) directly (and that nslookup is installed):
artu@desktop:$ nslookup google.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: google.com
Address: 216.58.209.78
In that case you do not need to mess with DOCKSAL_DNS_UPSTREAM=192.168.1.1.
I installed resolvconf.
This was probably the key problem.
Try the following:
DOCKSAL_DNS_UPSTREAMsudo apt-get install ifupdown resolvconf -y (I know you have resolvconf already installed)fin reset systemnslookup test.docksalnslookup google.comToday I installed latest Ubuntu from scratch and I had same issues.
I can confirm that this fixed it.
sudo apt-get install ifupdown resolvconf -y
fin reset system
I think this one was closed in scope of #321
PR https://github.com/docksal/docksal/commit/fbf8287f4c482c45742e32c45a9a9fb0cc9a171d
The solution for my Debian 9 is adding my router IP to /etc/network/interfaces in dns-nameservers line.
My value: dns-nameservers 192.168.64.100 192.168.1.1
@ArtuGit please share the entire network interface definition where you have dns-nameservers 192.168.64.100 192.168.1.1. Is it in the local interface definition that Docksal extends?
I'm having the same issue. I'm using the following:
When I type fin system reset dns I get the following:
$fin system reset dns
WARNING: No swap limit support
Resetting Docksal DNS service and configuring resolver for .docksal domain...
upstream 127.0.1.1
WARNING: Localhost DNS setting (--dns=127.0.1.1) may fail in containers.
Enabling automatic *.docksal DNS resolver...
ERROR: The upstream DNS server (127.0.1.1) is not reachable.
You are either offline, 127.0.1.1 is not a valid DNS server, or DNS requests to 127.0.1.1 are blocked.
Once the current operation completes, follow the steps below:
1. Open ~/.docksal/docksal.env and set DOCKSAL_DNS_UPSTREAM to your local network DNS server
2. Run fin system reset dns to see if it works
I've tried setting DOCKSAL_DNS_UPSTREAM to a number of different values (127.0.0.1, 127.0.1.1, 192.168.64.100, 192.168.64.1) and get the same result.
I was able to get it working by adding 192.168.1.1 as the DOCKSAL_DNS_UPSTREAM which I found by running:
$ ip route | grep default
default via 192.168.1.1 dev wlp1s0 proto static metric 600
@acouch ERROR: The upstream DNS server (127.0.1.1) is not reachable. has been discussed in https://github.com/docksal/docksal/issues/770 and should be addressed in the next release Docksal (1.11.0).
For now, you can use DOCKSAL_DNS_UPSTREAM=8.8.8.8 (Google DNS) or any other external DNS service you can/want to use. Using 192.168.1.1 (looks to be your network router) as the upstream DNS would bind you to the current network configuration, which may or may not be fine.
Most helpful comment
@acouch
ERROR: The upstream DNS server (127.0.1.1) is not reachable.has been discussed in https://github.com/docksal/docksal/issues/770 and should be addressed in the next release Docksal (1.11.0).For now, you can use
DOCKSAL_DNS_UPSTREAM=8.8.8.8(Google DNS) or any other external DNS service you can/want to use. Using192.168.1.1(looks to be your network router) as the upstream DNS would bind you to the current network configuration, which may or may not be fine.