[GH-ISSUE #103] Can't make it work properly (Got recursion not available) #44

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

Originally created by @b4dnewz on GitHub (Dec 4, 2018).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/103

Great package, I'm very exited to use it during development, I followed the installation process but unfortunately I can't make it work properly.

I'm on debian and using Docker version 17.12.0-ce, build c97c6d6, docker-compose version 1.17.1 and DPS Version: 2.9.1.

There are few things I've done for debugging, here follows the steps from the beginning:

Steps to reproduce the behavior:

  1. Installed and started DPS as service with: ref
docker run --hostname dns.mageddo --name dns-proxy-server -p 5380:5380 \
  --restart=unless-stopped -d \
  -v /opt/dns-proxy-server/conf:/app/conf \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /etc/resolv.conf:/etc/resolv.conf \
  defreitas/dns-proxy-server
  1. Added the hostname and started a container using docker-compose:
version: '3'
services:
  db:
    image: mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
  wordpress:
    image: wordpress
    restart: always
    hostname: testing.local
    depends_on:
      - db
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_PASSWORD: wordpress
  1. Tested if the whole thing was working:
$ nslookup testing.local
Server:		8.8.8.8
Address:	8.8.8.8#53

** server can't find testing.local: NXDOMAIN

Noticed it wasn't using the DPS container as DNS server, after inspecting the host resolv.conf file I see it hasn't been updated:

$ cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

I've opened the bash inside DPS and checked the respective resolv.conf file:

$ docker exec dns-proxy-server cat /etc/resolv.conf
nameserver 172.17.0.2 # dps-entry

So the resolv.conf file doesn't get automatically updated, I've updated manually adding nameserver 172.17.0.2 # dps-entry and tried again:

$ nslookup google.com
Server:		172.17.0.2
Address:	172.17.0.2#53

Non-authoritative answer:
Name:	google.com
Address: 216.58.205.110
Name:	google.com
Address: 2a00:1450:4002:808::200e

Now it's working fine with the internet, let's try the docker containers:

$ nslookup testing.local
;; Got recursion not available from 172.17.0.2, trying next server
Server:		8.8.8.8
Address:	8.8.8.8#53

** server can't find testing.local: NXDOMAIN

And the respective logs from dns-proxy-server:

2018/12/04 10:44:23 DEBUG f=dns.go:52 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=begin, reqId=45607, questions=1, question=testing.local., type=TypeA
2018/12/04 10:44:23 DEBUG f=dns.go:56 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=begin, solver=proxy.SystemDnsSolver
2018/12/04 10:44:23 DEBUG f=dns.go:52 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=not-resolved, solver=proxy.SystemDnsSolver, err=host not found
2018/12/04 10:44:23 DEBUG f=dns.go:56 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=begin, solver=proxy.DockerDnsSolver
2018/12/04 10:44:23 DEBUG f=docker.go:31 pkg=github.com/mageddo/dns-proxy-server/proxy.DockerDnsSolver m=doSolve uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 solver=docker, status=solved-key, question=testing.local., hostname=testing.local, ip=172.23.0.4
2018/12/04 10:44:23 DEBUG f=dns.go:63 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=answer-found, solver=proxy.DockerDnsSolver, length=1
2018/12/04 10:44:23 DEBUG f=defaults.go:15 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=resolved, solver=proxy.DockerDnsSolver, length=1, answer=testing.local.	0	IN	A	172.23.0.4

I hope this help to figure out what's the problem, thanks in advance.

Originally created by @b4dnewz on GitHub (Dec 4, 2018). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/103 Great package, I'm very exited to use it during development, I followed the installation process but unfortunately I can't make it work properly. I'm on debian and using __Docker version 17.12.0-ce, build c97c6d6__, __docker-compose version 1.17.1__ and __DPS Version: 2.9.1__. There are few things I've done for debugging, here follows the steps from the beginning: Steps to reproduce the behavior: 1. Installed and started DPS as service with: [ref](http://mageddo.github.io/dns-proxy-server/docs/running.html#installing-it-as-a-linux-service) ```bash docker run --hostname dns.mageddo --name dns-proxy-server -p 5380:5380 \ --restart=unless-stopped -d \ -v /opt/dns-proxy-server/conf:/app/conf \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /etc/resolv.conf:/etc/resolv.conf \ defreitas/dns-proxy-server ``` 2. Added the hostname and started a container using docker-compose: ```yml version: '3' services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: image: wordpress restart: always hostname: testing.local depends_on: - db environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress ``` 3. Tested if the whole thing was working: ``` $ nslookup testing.local Server: 8.8.8.8 Address: 8.8.8.8#53 ** server can't find testing.local: NXDOMAIN ``` Noticed it wasn't using the DPS container as DNS server, after inspecting the host resolv.conf file I see it hasn't been updated: ``` $ cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 ``` I've opened the bash inside DPS and checked the respective `resolv.conf` file: ``` $ docker exec dns-proxy-server cat /etc/resolv.conf nameserver 172.17.0.2 # dps-entry ``` So the `resolv.conf` file doesn't get automatically updated, I've updated manually adding `nameserver 172.17.0.2 # dps-entry` and tried again: ``` $ nslookup google.com Server: 172.17.0.2 Address: 172.17.0.2#53 Non-authoritative answer: Name: google.com Address: 216.58.205.110 Name: google.com Address: 2a00:1450:4002:808::200e ``` Now it's working fine with the internet, let's try the docker containers: ``` $ nslookup testing.local ;; Got recursion not available from 172.17.0.2, trying next server Server: 8.8.8.8 Address: 8.8.8.8#53 ** server can't find testing.local: NXDOMAIN ``` And the respective logs from dns-proxy-server: ``` 2018/12/04 10:44:23 DEBUG f=dns.go:52 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=begin, reqId=45607, questions=1, question=testing.local., type=TypeA 2018/12/04 10:44:23 DEBUG f=dns.go:56 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=begin, solver=proxy.SystemDnsSolver 2018/12/04 10:44:23 DEBUG f=dns.go:52 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=not-resolved, solver=proxy.SystemDnsSolver, err=host not found 2018/12/04 10:44:23 DEBUG f=dns.go:56 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=begin, solver=proxy.DockerDnsSolver 2018/12/04 10:44:23 DEBUG f=docker.go:31 pkg=github.com/mageddo/dns-proxy-server/proxy.DockerDnsSolver m=doSolve uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 solver=docker, status=solved-key, question=testing.local., hostname=testing.local, ip=172.23.0.4 2018/12/04 10:44:23 DEBUG f=dns.go:63 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=answer-found, solver=proxy.DockerDnsSolver, length=1 2018/12/04 10:44:23 DEBUG f=defaults.go:15 pkg=main m=handleQuestion uuid=2AAF6BD4-EDEF-12ED-FDE0-E3BF6FAB92A7 status=resolved, solver=proxy.DockerDnsSolver, length=1, answer=testing.local. 0 IN A 172.23.0.4 ``` I hope this help to figure out what's the problem, thanks in advance.
kerem closed this issue 2026-02-26 04:33:53 +03:00
Author
Owner

@mageddo commented on GitHub (Dec 4, 2018):

Thank you to be using DPS.

Looks like we have two issues here.

1. DPS don't update your resolvconf automatically

Last days I experienced some issues with docker volume when you just make a volume for one file.

looks like docker lost file reference then file changes don't make effect on the host machine.

I will elaborate a way to fix this later, stay sharp

2. DPS don't solve others containers IPs

That's really weird, never got this, please try clear your /etc/resolv.conf and put only DPS entry, something like that

nameserver x.x.x.x
<!-- gh-comment-id:444070479 --> @mageddo commented on GitHub (Dec 4, 2018): Thank you to be using DPS. Looks like we have two issues here. **1. DPS don't update your resolvconf automatically** Last days I experienced some issues with docker volume when you just make a volume for one file. looks like docker lost file reference then file changes don't make effect on the host machine. I will elaborate a way to fix this later, stay sharp **2. DPS don't solve others containers IPs** That's really weird, never got this, please try clear your /etc/resolv.conf and put only DPS entry, something like that ``` nameserver x.x.x.x ```
Author
Owner

@b4dnewz commented on GitHub (Dec 4, 2018):

Hi @mageddo thanks for your quick reply!

Try removing DPS conf volume from container start

Has fixed the problem of the resolve.conf automatic update and apparently also the resolving of the other containers, that's awesome!

The problem probably came from the default configuration, now I can start using it, thanks again.

<!-- gh-comment-id:444073376 --> @b4dnewz commented on GitHub (Dec 4, 2018): Hi @mageddo thanks for your quick reply! > Try removing DPS conf volume from container start Has fixed the problem of the `resolve.conf` automatic update and apparently also the resolving of the other containers, __that's awesome__! The problem probably came from the default configuration, now I can start using it, thanks again.
Author
Owner

@mageddo commented on GitHub (Dec 4, 2018):

Really? I didn't expect that to work lol

  1. Can you send me the content of the files at /opt/dns-proxy-server/conf directory?
  2. Did you do some change on config.json?

Cause maybe I could introduced a bug on 2.9.1 creating an invalid config.json when it doesn't exists

<!-- gh-comment-id:444075127 --> @mageddo commented on GitHub (Dec 4, 2018): Really? I didn't expect that to work lol 1. Can you send me the content of the files at `/opt/dns-proxy-server/conf` directory? 2. Did you do some change on config.json? Cause maybe I could introduced a bug on 2.9.1 creating an invalid config.json when it doesn't exists
Author
Owner

@b4dnewz commented on GitHub (Dec 4, 2018):

Sorry for the delay, I was having lunch :)

$cat /opt/dns-proxy-server/conf/config.json 
{
	"remoteDnsServers": [],
	"envs": [
		{
			"name": ""
		}
	],
	"activeEnv": "",
	"lastId": 3,
	"webServerPort": 0,
	"dnsServerPort": 0,
	"defaultDns": null,
	"logLevel": "",
	"logFile": "",
	"registerContainerNames": null
}

I'm testing it out now and I'll update you if I have more troubles or questions, thanks!

<!-- gh-comment-id:444105913 --> @b4dnewz commented on GitHub (Dec 4, 2018): Sorry for the delay, I was having lunch :) ``` $cat /opt/dns-proxy-server/conf/config.json { "remoteDnsServers": [], "envs": [ { "name": "" } ], "activeEnv": "", "lastId": 3, "webServerPort": 0, "dnsServerPort": 0, "defaultDns": null, "logLevel": "", "logFile": "", "registerContainerNames": null } ``` I'm testing it out now and I'll update you if I have more troubles or questions, thanks!
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#44
No description provided.