Closed jakeparis closed 2 years ago
Can you resolve foobar.local
from inside the PHP container?
I sure can!
devilbox@php-8.1.5 in /shared/httpd $ ping foobar.local
PING foobar.local (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.045 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.230 ms
Hmm, that means that the DNS server is functioning correctly. Can you check your system's DNS settings to see if you're actually using the the DNS server from 127.0.0.1
on your host system.
This what I get from a nslookup
on the host machine:
jparis in ~ $ nslookup foobar.local
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: foobar.local
Address: 127.0.0.1
jparis in ~ $ nslookup duckduckgo.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: duckduckgo.com
Address: 52.149.246.39
Are you able to successfully ping
it from your host system?
This seems to have something to do with using the .local
TLD. When I used dig
I got the following. Note the WARNING.
jparis in ~ $ dig foobar.local
; <<>> DiG 9.10.6 <<>> foobar.local
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51840
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;foobar.local. IN A
;; ANSWER SECTION:
foobar.local. 5 IN A 127.0.0.1
;; ADDITIONAL SECTION:
rpz. 1 IN SOA bind. admin.bind. 1650553800 1200 180 1209600 10800
;; Query time: 3 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Apr 22 08:51:51 EDT 2022
;; MSG SIZE rcvd: 106
So I changed the TLD to foo and it works perfectly. I know that using .local should be an accepted practice, as that's what I've always used, and it's even in the .env comments as a suggestion. Does this perhaps have something to do with a recent Mac OSX update, I wonder.
Are you able to successfully
ping
it from your host system?
No, it doesn't ever return.
Are you able to successfully
ping
it from your host system?No, it doesn't ever return.
That could be a Mac thing then. Unfortunately I don't have one at hand to further debug this. If .local
does not seem to work, then I will have to update the docs accordingly.
local
seems indeed to be reserved for multicast DNS. After a quick google search I found a few other issues with Ubuntu and Fedora regarding the same.
Wiki makes it clear: https://en.wikipedia.org/wiki/Multicast_DNS
So local
should then be avoided.
Now that I see what to look up, there's a lot of helpful information for people like me, who know nothing about DNS. https://serverfault.com/a/399958 for example and https://discussions.apple.com/thread/6555023
So @cytopia thank you for all of your assistance as usual. At this point, I'm not sure if this is something that needs to be "fixed" in the project or the docs, or if I should simply stop using .local
and that's the end of it.
Want me to do a PR updating some docs and things?
I'd say we keep this issue open, until I've adjusted the docs and comments in .env
. Feel free to submit anything if you'd like
@jakeparis thanks for the PR! :+1:
Have you already looked into this bug?
(Optional) Error message
No response
What went wrong?
On my Mac, AutoDNS used to work just fine. I have my tld set to to
.local
and so all I needed to do was create a directory in my data root (for examplefoobar
), and then visit it athttps://foobar.local
.Now this no longer works. The only way I can get to the domain is by manually adding a
/etc/hosts
entry (e.g.127.0.0.1 foobar.local
) for every domain I create.Expected behaviour
My expectation is that simply by adding a directory in my data root, it is picked up in DNS
How can we reproduce the bug?
I have devilbox checked out to the v2.1.1 branch.
I have run
I have the following in my .env:
I have 127.0.0.1 set in my network settings as the top DNS Server for the active network.
I turned on
BIND_LOG_DNS_QUERIES=1
and when I look at the docker logs, I can see hits when I visit the devilbox intranet page, and I can see hits for my regular web browsing (I guess since the 127.0.0.1 is set as the first DNS resolver), but when I visit one of my project domains (foobar.local
), I get no logs at all.On the Virtual Hosts page of the intranet, all my projects are listed there, but they are all listed with _ERR | No Host DNS record found.`
Host Operating System
macOS
Host Platform (amd64, arm64, other)
other
(Linux only) Is SELinux enabled?
I am not on Linux
Docker version
Docker version 20.10.13, build a224086
Docker Compose version
docker-compose version 1.29.2, build 5becea4c
Devilbox version
v2.1.1
Have you removed stopped containers before starting?
Yes
Have you pulled latest Docker images before starting?
Yes
Devilbox start command
docker-compose up -d bind httpd mysql php memcd
Config: .env file
See above for relevant bits
Config: docker-compose.override.yml
No response
Config: ./check-config.sh
(Optional) Additional information
I am on a Mac Version 12.3.1 with an Intel chip.