[GH-ISSUE #202] Got recursion not available from [ip], trying next server #84

Closed
opened 2026-02-26 04:33:59 +03:00 by kerem · 3 comments
Owner

Originally created by @garstas on GitHub (Jul 8, 2020).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/202

What is Happening

I'm trying to set up the proxy server and I can't understand the problem i have. So, I set up the proxy with these configs:

DPS config:

{
  "remoteDnsServers": [[172, 17, 0, 1], [10, 0, 0, 10]],
  "envs": [
    {
      "name": "",
      "hostnames": [
              {
                "id": 1,
                "hostname": ".localhost",
                "ip": [192, 168, 31, 25],
                "ttl": 1
              }
      ]
    }
  ],
  "activeEnv": "",
  "lastId": 1,
  "webServerPort": 0,
  "dnsServerPort": 0,
  "defaultDns": null,
  "logLevel": "INFO",
  "logFile": "console",
  "registerContainerNames": null
}

docker-compose.yml:

  dns:
    restart: always
    image: defreitas/dns-proxy-server:2.9.1
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - /etc:/host/etc
        - ./dns/config.json:/app/conf/config.json
    labels:
        traefik.frontend.rule: "Host:dns.${LOCAL_DOMAIN_ZONE}"
        traefik.port: "5380"
    environment:
      - MG_RESOLVCONF=/host/etc/resolv.conf
    ports:
        - ${DOCKER_IP}:53:53/udp
        - ${HOST_IP}:53:53/udp

And I'm trying to access my database container using the hostname, but it's not working. Here are some results:

resolv.conf on host machine

cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

  nameserver 172.17.0.1
  nameserver 10.0.0.10
# nameserver 127.0.0.53 # dps-comment
nameserver 192.168.144.3 # dps-entry

dig is reaching the correct IP address of my container:

dig db.convert.service

; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> db.convert.service
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9381
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;db.convert.service.		IN	A

;; ANSWER SECTION:
db.convert.service.	0	IN	A	192.168.128.3

;; Query time: 0 msec
;; SERVER: 172.17.0.1#53(172.17.0.1)
;; WHEN: Wed Jul 08 16:17:40 MSK 2020
;; MSG SIZE  rcvd: 70

nslookup without/with dns:

nslookup db.convert.service              
;; Got recursion not available from 172.17.0.1, trying next server
Server:		10.0.0.10
Address:	10.0.0.10#53

** server can't find db.convert.service: NXDOMAIN
nslookup db.convert.service 192.168.144.3
Server:		192.168.144.3
Address:	192.168.144.3#53

Non-authoritative answer:
Name:	db.convert.service
Address: 192.168.128.3
Name:	db.convert.service
Address: 192.168.128.3

I guess the problem is with my resolv.conf, but I can't understand how to fix it. Any help appreciated.

What is expected

Correct hostname resolution

Steps to Reproduce

I think it's my system's setup problem.

Specs:

Originally created by @garstas on GitHub (Jul 8, 2020). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/202 ### What is Happening I'm trying to set up the proxy server and I can't understand the problem i have. So, I set up the proxy with these configs: DPS config: ```json { "remoteDnsServers": [[172, 17, 0, 1], [10, 0, 0, 10]], "envs": [ { "name": "", "hostnames": [ { "id": 1, "hostname": ".localhost", "ip": [192, 168, 31, 25], "ttl": 1 } ] } ], "activeEnv": "", "lastId": 1, "webServerPort": 0, "dnsServerPort": 0, "defaultDns": null, "logLevel": "INFO", "logFile": "console", "registerContainerNames": null } ``` docker-compose.yml: ```bash dns: restart: always image: defreitas/dns-proxy-server:2.9.1 volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc:/host/etc - ./dns/config.json:/app/conf/config.json labels: traefik.frontend.rule: "Host:dns.${LOCAL_DOMAIN_ZONE}" traefik.port: "5380" environment: - MG_RESOLVCONF=/host/etc/resolv.conf ports: - ${DOCKER_IP}:53:53/udp - ${HOST_IP}:53:53/udp ``` And I'm trying to access my database container using the hostname, but it's not working. Here are some results: `resolv.conf` on host machine ```bash cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers. nameserver 172.17.0.1 nameserver 10.0.0.10 # nameserver 127.0.0.53 # dps-comment nameserver 192.168.144.3 # dps-entry ``` `dig` is reaching the correct IP address of my container: ```bash dig db.convert.service ; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> db.convert.service ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9381 ;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;db.convert.service. IN A ;; ANSWER SECTION: db.convert.service. 0 IN A 192.168.128.3 ;; Query time: 0 msec ;; SERVER: 172.17.0.1#53(172.17.0.1) ;; WHEN: Wed Jul 08 16:17:40 MSK 2020 ;; MSG SIZE rcvd: 70 ``` `nslookup` without/with dns: ```bash nslookup db.convert.service ;; Got recursion not available from 172.17.0.1, trying next server Server: 10.0.0.10 Address: 10.0.0.10#53 ** server can't find db.convert.service: NXDOMAIN ``` ```bash nslookup db.convert.service 192.168.144.3 Server: 192.168.144.3 Address: 192.168.144.3#53 Non-authoritative answer: Name: db.convert.service Address: 192.168.128.3 Name: db.convert.service Address: 192.168.128.3 ``` I guess the problem is with my `resolv.conf`, but I can't understand how to fix it. Any help appreciated. ### What is expected Correct hostname resolution ### Steps to Reproduce I think it's my system's setup problem. **Specs:** - OS: `Ubuntu 18.04` - Docker Version: `19.03.6` - DPS Version: `2.9.1` - Please attach DPS Log file: https://pastebin.com/7KLVfUTg (it's normal, no errors)
kerem closed this issue 2026-02-26 04:33:59 +03:00
Author
Owner

@garstas commented on GitHub (Jul 8, 2020):

If I comment out the first two entries in resolv.conf, the DPS is working. I guess i should dig into the problem itself (specifically why 10.0.0.10 is breaking the resolution).

<!-- gh-comment-id:655572913 --> @garstas commented on GitHub (Jul 8, 2020): If I comment out the first two entries in `resolv.conf`, the DPS is working. I guess i should dig into the problem itself (specifically why 10.0.0.10 is breaking the resolution).
Author
Owner

@garstas commented on GitHub (Jul 8, 2020):

For the future readers: i solved the problem by deleting the 10.0.0.10 IP from the /etc/resolvconf/resolv.conf.d/head file. I guess it was accidentally put there, and this strange address sure does not belong in resolv.conf file.

<!-- gh-comment-id:655607284 --> @garstas commented on GitHub (Jul 8, 2020): For the future readers: i solved the problem by deleting the `10.0.0.10` IP from the `/etc/resolvconf/resolv.conf.d/head` file. I guess it was accidentally put there, and this strange address sure does not belong in `resolv.conf` file.
Author
Owner

@mageddo commented on GitHub (Jul 10, 2020):

Generally it's tricky to have more than one nameserver entry at the resolv.conf

<!-- gh-comment-id:656410206 --> @mageddo commented on GitHub (Jul 10, 2020): Generally it's tricky to have more than one nameserver entry at the resolv.conf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dns-proxy-server-mageddo#84
No description provided.