Skip to content

DNS resolv doesn't work as expected #64

Description

@jiramares

I am using latest commit (merge of gh-57-intranet-dns branch).

I have following settings in project (file .sandcat/settings.json) and there is no file .sandcat/settings.local.json):

{
  "network": [
    {
      "action": "allow",
      "host": "*",
      "method": "GET"
    }
  ]
}

So from mine point of view any DNS resolv is enabled.

We have internet and intranet domain. Both are specified in search domains on host computer (mine computer). Mine local /etc/resolv.conf:

nameserver 127.0.0.53
options edns0 trust-ad
search internet_domain.cz intranet_domain.cz

You configure dnsmasq following way (no dns server specification in any settings.json - standard docker resolver uses lokally specified DNS -> so it should work if routed to docker resolver):

Jun  2 11:24:09 dnsmasq[69]: using nameserver 127.0.0.11#53 for domain internet_domain.cz 
Jun  2 11:24:09 dnsmasq[69]: using nameserver 127.0.0.11#53 for domain intranet_domain.cz 
Jun  2 11:24:09 dnsmasq[69]: using nameserver 1.1.1.1#53
Jun  2 11:24:09 dnsmasq[69]: using nameserver 8.8.8.8#53

And this configuration doesn't behave as expected (specified in documentation). None of our servers is resolved. If I install nslookup into agent container I get:

1) 
nslookup www.seznam.cz
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   www.seznam.cz
Address: 77.75.77.222
Name:   www.seznam.cz
Address: 77.75.79.222
Name:   www.seznam.cz
Address: 2a02:598:2::1222
Name:   www.seznam.cz
Address: 2a02:598:a::79:222

2) 
nslookup server.internet_domain.cz
;; Got SERVFAIL reply from 127.0.0.1
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find server.internet_domain.cz: SERVFAIL

3) 
nslookup server.intranet_domain.cz
;; Got SERVFAIL reply from 127.0.0.1
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find server.intranet_domain.cz: SERVFAIL

4) 
nslookup mitmproxy
;; Got SERVFAIL reply from 127.0.0.1
Server:         127.0.0.1
Address:        127.0.0.1#53

** server can't find mitmproxy.internet_domain.cz: SERVFAIL

Ad 1) I am looking public internet server - it works - we enabled any lookup so it is okay.

Ad 2) Our own internet server doesn't work because the internet_domain.cz is specified in dns lookup (if it is removed -> it works). This resolv doesn't need our internal DNS server because it is public server. So forwarding lookup domains to 127.0.0.11 causes it doesn't work.

Ad 3) Our intranet server doesn't work because the intranet_domain.cz is specified in dns lookup. And this traffic is in dnsmasq forwarded to 127.0.0.11 that should work and should go via our internal DNS servers.

Ad 4) Doesn't work - how to configure container to reach it.

Finally I have installed in compose-all.yml ubuntu server and tried nslookup from it and all resolves works. It means:

a) the docker resolve can resolv the name of other container (example 4)
b) the docker resolve goes via our internal dns server configured on mine host so we don't need anything extra to resolv intranet servers (example 3)
c) the docker resolv can resolv our and even common public server (example 1 & 2)

From mine point of view is dnsmasq misconfigured. The resolver '127.0.0.11` doesn't resolv anything and I don't know. Don't know how to force it to resolve something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions