[GH-ISSUE #513] Disable remote resolvers through config.json not working since 3.19.2 #176

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

Originally created by @Sajito on GitHub (Jul 16, 2024).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/513

What is Happening

As the title says, it's currently impossible to disable remote resolvers using the config.json.
I found that with 3.19.2 the config has been refactored to use solverRemote.active instead of noRemoteServers.
But both settings in the json file won't disable them.

My config file looks like this:

{
  "version": 2,
  "activeEnv": "",
  "webServerPort": null,
  "dnsServerPort": null,
  "defaultDns": null,
  "logLevel": null,
  "logFile": null,
  "registerContainerNames": null,
  "hostMachineHostname": null,
  "domain": null,
  "dpsNetwork": true,
  "dpsNetworkAutoConnect": true,
  "resolvConfOverrideNameServers": false,
  "noRemoteServers": true,
  "noEntriesResponseCode": 2,
  "remoteDnsServers": [],
  "envs": [
    {
      "name": "",
      "hostnames": [
        {
          "id": 1,
          "hostname": ".localhost",
          "ip": "",
          "target": "host.docker",
          "ttl": 3600,
          "type": "CNAME"
        }
      ]
    }
  ],
  "solverRemote": {
    "active": false
  }
}

Using the command line flag works fine, though.

What is Expected

When querying for anything not listed in the config file, an error should be returned.
E. g. with the config above when querying for google.com, the response should be SERVFAIL, but instead the domain is actually resolved.

Specs

  • Docker Version:
    Client:
    Version:           27.0.3
    API version:       1.46
    Go version:        go1.22.4
    Git commit:        7d4bcd863a
    Built:             Mon Jul  1 21:15:54 2024
    OS/Arch:           linux/amd64
    Context:           default
    
    Server:
    Engine:
    Version:          27.0.3
    API version:      1.46 (minimum version 1.24)
    Go version:       go1.22.4
    Git commit:       662f78c0b1
    Built:            Mon Jul  1 21:15:54 2024
    OS/Arch:          linux/amd64
    Experimental:     false
    containerd:
    Version:          v1.7.19
    GitCommit:        2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41.m
    runc:
    Version:          1.1.13
    GitCommit:        
    docker-init:
    Version:          0.19.0
    GitCommit:        de40ad0
    
  • DPS Version:
    • 3.24.0-snapshot, but tried every version since 3.19.2
Originally created by @Sajito on GitHub (Jul 16, 2024). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/513 ## What is Happening As the title says, it's currently impossible to disable remote resolvers using the `config.json`. I found that with 3.19.2 the config [has been refactored](https://github.com/mageddo/dns-proxy-server/pull/470) to use `solverRemote.active` instead of `noRemoteServers`. But both settings in the json file won't disable them. My config file looks like this: ```json { "version": 2, "activeEnv": "", "webServerPort": null, "dnsServerPort": null, "defaultDns": null, "logLevel": null, "logFile": null, "registerContainerNames": null, "hostMachineHostname": null, "domain": null, "dpsNetwork": true, "dpsNetworkAutoConnect": true, "resolvConfOverrideNameServers": false, "noRemoteServers": true, "noEntriesResponseCode": 2, "remoteDnsServers": [], "envs": [ { "name": "", "hostnames": [ { "id": 1, "hostname": ".localhost", "ip": "", "target": "host.docker", "ttl": 3600, "type": "CNAME" } ] } ], "solverRemote": { "active": false } } ``` Using the command line flag works fine, though. ## What is Expected When querying for anything not listed in the config file, an error should be returned. E. g. with the config above when querying for `google.com`, the response should be `SERVFAIL`, but instead the domain is actually resolved. ## Specs * Docker Version: ``` Client: Version: 27.0.3 API version: 1.46 Go version: go1.22.4 Git commit: 7d4bcd863a Built: Mon Jul 1 21:15:54 2024 OS/Arch: linux/amd64 Context: default Server: Engine: Version: 27.0.3 API version: 1.46 (minimum version 1.24) Go version: go1.22.4 Git commit: 662f78c0b1 Built: Mon Jul 1 21:15:54 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.7.19 GitCommit: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41.m runc: Version: 1.1.13 GitCommit: docker-init: Version: 0.19.0 GitCommit: de40ad0 ``` * DPS Version: * `3.24.0-snapshot`, but tried every version since 3.19.2
kerem 2026-02-26 04:34:17 +03:00
Author
Owner

@mageddo commented on GitHub (Jul 16, 2024):

DPS is depending on this solverRemote.circuitBreaker to be defined to consider noRemoteServers flag. The bug is here github.com/mageddo/dns-proxy-server@68a4758c3b/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/ConfigDAOJson.java (L97-L98)

This will work

{
  "version": 2,
  "activeEnv": "",
  "webServerPort": null,
  "dnsServerPort": null,
  "defaultDns": null,
  "logLevel": null,
  "logFile": null,
  "registerContainerNames": null,
  "hostMachineHostname": null,
  "domain": null,
  "dpsNetwork": true,
  "dpsNetworkAutoConnect": true,
  "resolvConfOverrideNameServers": false,
  "noEntriesResponseCode": 2,
  "remoteDnsServers": [],
  "envs": [
    {
      "name": "",
      "hostnames": [
        {
          "id": 1,
          "hostname": ".localhost",
          "ip": "",
          "target": "host.docker",
          "ttl": 3600,
          "type": "CNAME"
        }
      ]
    }
  ],
  "noRemoteServers": true,
  "solverRemote": {
    "circuitBreaker": {
      "failureThreshold": 3,
      "failureThresholdCapacity": 10,
      "successThreshold": 5,
      "testDelay": "PT20S"
    }
  }
}

This will not

{
  "version": 2,
  "activeEnv": "",
  "webServerPort": null,
  "dnsServerPort": null,
  "defaultDns": null,
  "logLevel": null,
  "logFile": null,
  "registerContainerNames": null,
  "hostMachineHostname": null,
  "domain": null,
  "dpsNetwork": true,
  "dpsNetworkAutoConnect": true,
  "resolvConfOverrideNameServers": false,
  "noEntriesResponseCode": 2,
  "remoteDnsServers": [],
  "envs": [
    {
      "name": "",
      "hostnames": [
        {
          "id": 1,
          "hostname": ".localhost",
          "ip": "",
          "target": "host.docker",
          "ttl": 3600,
          "type": "CNAME"
        }
      ]
    }
  ],
  "noRemoteServers": true
}
<!-- gh-comment-id:2231444975 --> @mageddo commented on GitHub (Jul 16, 2024): DPS is depending on this `solverRemote.circuitBreaker` to be defined to consider `noRemoteServers` flag. The bug is here https://github.com/mageddo/dns-proxy-server/blob/68a4758c3b9f2e20cd964b199b49024306c7eb42/src/main/java/com/mageddo/dnsproxyserver/config/dataprovider/ConfigDAOJson.java#L97-L98 This will work ```json { "version": 2, "activeEnv": "", "webServerPort": null, "dnsServerPort": null, "defaultDns": null, "logLevel": null, "logFile": null, "registerContainerNames": null, "hostMachineHostname": null, "domain": null, "dpsNetwork": true, "dpsNetworkAutoConnect": true, "resolvConfOverrideNameServers": false, "noEntriesResponseCode": 2, "remoteDnsServers": [], "envs": [ { "name": "", "hostnames": [ { "id": 1, "hostname": ".localhost", "ip": "", "target": "host.docker", "ttl": 3600, "type": "CNAME" } ] } ], "noRemoteServers": true, "solverRemote": { "circuitBreaker": { "failureThreshold": 3, "failureThresholdCapacity": 10, "successThreshold": 5, "testDelay": "PT20S" } } } ``` This will not ```json { "version": 2, "activeEnv": "", "webServerPort": null, "dnsServerPort": null, "defaultDns": null, "logLevel": null, "logFile": null, "registerContainerNames": null, "hostMachineHostname": null, "domain": null, "dpsNetwork": true, "dpsNetworkAutoConnect": true, "resolvConfOverrideNameServers": false, "noEntriesResponseCode": 2, "remoteDnsServers": [], "envs": [ { "name": "", "hostnames": [ { "id": 1, "hostname": ".localhost", "ip": "", "target": "host.docker", "ttl": 3600, "type": "CNAME" } ] } ], "noRemoteServers": true } ```
Author
Owner

@mageddo commented on GitHub (Jul 16, 2024):

@Sajito fix was made, releasing 3.24.1-snapshot right now

<!-- gh-comment-id:2231833230 --> @mageddo commented on GitHub (Jul 16, 2024): @Sajito fix was made, releasing `3.24.1-snapshot` right now
Author
Owner

@mageddo commented on GitHub (Jul 16, 2024):

The JSON config file stays unchanged, just the internals of DPS has been changed

<!-- gh-comment-id:2231837845 --> @mageddo commented on GitHub (Jul 16, 2024): The JSON config file stays unchanged, just the internals of DPS has been changed
Author
Owner

@Sajito commented on GitHub (Jul 17, 2024):

Thanks, working fine again!

<!-- gh-comment-id:2232480366 --> @Sajito commented on GitHub (Jul 17, 2024): Thanks, working fine again!
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#176
No description provided.