[GH-ISSUE #267] DNS Proxy Server 3 #105

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

Originally created by @mageddo on GitHub (Jan 29, 2023).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/267

Acceptance Criteria

Re-Write all features current version of DPS in Java using GraalVM Native Image so I can be more productive and contribute more to this project.

Context

  • I'm really rust in Golang, spend 99% of time coding in Java so when I come to code at this project I have change the paradigm , remember about the build tool, libraries and all Go program language stuff, it's reducing my productivity in this project, I don't have much time to spend also.
  • I'm also having to pay a Goland idea license to be able to program in Go, this is the unique Go project I contribute to though
  • Different from 5 years ago, nowadays you can build a really nice binary program with a low memory footprint coding in java using GraalVM
  • GraalVM probably won't make DPS considerably less compatible with the use cases that it have today, as native image can generate binaries for arm, x86_x64, also supports linux, mac and windows.

Scope

The project will respect the following requirements

  • A strict remake: Implement all current features with the same behavior, possibly fixing known bugs, keeping the GUI, config files, API with the same actual contract being compatible with DPS 2
  • Stack
    • GraalVM 22.3
    • Java 17
  • Use the minimum of libraries and write the minimum of code as possible so the output binary program can be small, use a low memory footprint, also have more chances to be compatible of a larger set of hardware and SO environments
  • The frontend stack and code will remain the very same, this is just a backend refactoring
  • Use byte and short numeric types when possible to reduce memory usage [1]

Steps

The steps are defined in priority order

Basic Structure

  • Setup basic structure being able to compile a graalvm binary for linux x86_x64
  • Docker must be optional, DPS must be usable without docker features
  • Update the running it docs

DNS Server

Configure DNS server for future config of the following solvers

  • UDP
  • TCP

Fix incomplete DPS A response (Warning)

  • Done
nslookup -po=8053 host.docker 127.0.0.1
;; Warning: query response not set
Server:		127.0.0.1
Address:	127.0.0.1#8053

Non-authoritative answer:
Name:	host.docker
Address: 172.17.0.1
;; Warning: query response not set
Name:	host.docker
Address: 172.17.0.1

Docker Container Solving

  • Solve containers by its hostname or HOSTNAME env
  • DPS network feature, prefer to solve ips from DPS network when available
  • Support for dps.network customized network
  • Find hostname by container name or service name Config.registerContainerNames

Local DB Container Solving

  • Local DB Container Solving respect the current env
  • Automatically detects Entry type, when IP is set type=A, when target is set type=CNAME
  • Generate random id for env entry when it's null
  • CNAME Support

Internet Container Solving

  • Proxy queries and solve from remote server
  • Configurable multi remote servers

Solver Caching

  • Create a solver cache and configure for local db, docker and remote server.

System solver

  • Criar o system solver para resolver a variável Config.hostMachineHostname

Config

  • JSON Config
  • Command line / Flags Config
  • Environment Config
  • Logs, log file...
  • Criar network bridge quando Config.dpsNetwork = true, e quando Config.dpsNetworkAutoConnect = true criar e conectar todos os containers nessa bridge assim todos resolverao uma mesma network e poderao se comunicar

GUI Support

  • Create REST API respecting current contracts
  • Make a backup for the json when it suffer a version upgrade from 1 to 2

Auto Configure

Be able to automatically configure DPS as the default DNS Server in the current OS and restore previous server when it shutdown

Install as Service

https://github.com/mageddo/dns-proxy-server/issues/325

Manual Acceptance Tests

Windows

👋 Windows issues are being tracked on this issue https://github.com/mageddo/dns-proxy-server/issues/308

Linux

  • Creating a network while dps is running is crashing the server, the server wont log anything and will stay started but wont respond any query, connection refused will be got by the client, docker network create --attachable network3
    • couldn't reproduce anymore
  • When no default network names are found, must prioritize to use bridge network over overlay, also update this doc
  • Implement v1 api http://mageddo.github.io/dns-proxy-server/latest/en/api/
  • Remove quarkus logo
  • Timed out remote servers responses are being cached, it cant happen, when its a timeout cant cache but when the record really dont exists, like AAAA for bookmarks.mageddo.com must cache.
  • Must read conf from dps binary path not the current os path where dps was called
  • Log level not being respected, at least no when running in native image binary

Mac

...

Others

  • Delete v2 legacy version file
  • CI
  • CD
    • Linux amd64 + Docker Image
    • Linux aarch64 + Docker Image
    • Standard uber jar
Originally created by @mageddo on GitHub (Jan 29, 2023). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/267 ## Acceptance Criteria Re-Write all features current version of DPS in Java using GraalVM Native Image so I can be more productive and contribute more to this project. ### Context * I'm really rust in Golang, spend 99% of time coding in Java so when I come to code at this project I have change the paradigm , remember about the build tool, libraries and all Go program language stuff, it's reducing my productivity in this project, I don't have much time to spend also. * I'm also having to pay a Goland idea license to be able to program in Go, this is the unique Go project I contribute to though * Different from 5 years ago, nowadays you can build a really nice binary program with a low memory footprint coding in java using GraalVM * GraalVM probably won't make DPS considerably less compatible with the use cases that it have today, as native image can generate binaries for arm, x86_x64, also supports linux, mac and windows. ## Scope The project will respect the following requirements * A strict remake: Implement all current features with the same behavior, possibly fixing known bugs, keeping the GUI, config files, API with the same actual contract being compatible with DPS 2 * Stack * GraalVM 22.3 * Java 17 * Use the minimum of libraries and write the minimum of code as possible so the output binary program can be small, use a low memory footprint, also have more chances to be compatible of a larger set of hardware and SO environments * The frontend stack and code will remain the very same, this is just a backend refactoring * Use byte and short numeric types when possible to reduce memory usage [\[1\]][1] ## Steps The steps are defined in priority order ### Basic Structure * [x] Setup basic structure being able to compile a graalvm binary for linux x86_x64 * [x] Docker must be optional, DPS must be usable without docker features * [x] Update the running it docs #### DNS Server Configure DNS server for future config of the following solvers * [x] UDP * [x] TCP Fix incomplete DPS A response (Warning) * [x] Done ``` nslookup -po=8053 host.docker 127.0.0.1 ;; Warning: query response not set Server: 127.0.0.1 Address: 127.0.0.1#8053 Non-authoritative answer: Name: host.docker Address: 172.17.0.1 ;; Warning: query response not set Name: host.docker Address: 172.17.0.1 ``` #### Docker Container Solving * [x] Solve containers by its hostname or HOSTNAME env * [x] DPS network feature, prefer to solve ips from DPS network when available * [x] Support for `dps.network` customized network * [x] Find hostname by container name or service name Config.registerContainerNames #### Local DB Container Solving * [x] Local DB Container Solving respect the current env * [x] Automatically detects Entry type, when IP is set type=A, when target is set type=CNAME * [x] Generate random id for env entry when it's null * [x] CNAME Support #### Internet Container Solving * [x] Proxy queries and solve from remote server * [x] Configurable multi remote servers #### Solver Caching * [x] Create a solver cache and configure for local db, docker and remote server. #### System solver * [x] Criar o system solver para resolver a variável `Config.hostMachineHostname` ### Config * [x] JSON Config * [x] Command line / Flags Config * [x] Environment Config * [x] Logs, log file... * [x] Criar network bridge quando Config.dpsNetwork = true, e quando Config.dpsNetworkAutoConnect = true criar e conectar todos os containers nessa bridge assim todos resolverao uma mesma network e poderao se comunicar ### GUI Support * [x] Create REST API respecting current contracts * [x] Make a backup for the json when it suffer a version upgrade from 1 to 2 ### Auto Configure Be able to automatically configure DPS as the default DNS Server in the current OS and restore previous server when it shutdown * [x] Linux * Windows / Mac: https://github.com/mageddo/dns-proxy-server/issues/326 ### Install as Service https://github.com/mageddo/dns-proxy-server/issues/325 ### Manual Acceptance Tests #### Windows 👋 Windows issues are being tracked on this issue https://github.com/mageddo/dns-proxy-server/issues/308 #### Linux * [x] Creating a network while dps is running is crashing the server, the server wont log anything and will stay started but wont respond any query, connection refused will be got by the client, `docker network create --attachable network3` * couldn't reproduce anymore * [x] When no default network names are found, must prioritize to use bridge network over overlay, [also update this doc][2] * [x] Implement v1 api http://mageddo.github.io/dns-proxy-server/latest/en/api/ * [x] Remove quarkus logo * [x] Timed out remote servers responses are being cached, it cant happen, when its a timeout cant cache but when the record really dont exists, like AAAA for bookmarks.mageddo.com must cache. * [x] Must read conf from dps binary path not the current os path where dps was called * [x] Log level not being respected, at least no when running in native image binary #### Mac ... ### Others * [x] Delete v2 legacy version file * [x] CI * [x] CD * [x] Linux amd64 + Docker Image * [x] Linux aarch64 + Docker Image * [x] Standard uber jar [1]: https://stackoverflow.com/questions/14531235/in-java-is-it-more-efficient-to-use-byte-or-short-instead-of-int-and-float-inst [2]: http://mageddo.github.io/dns-proxy-server/latest/en/2-features/dps-network-resolution/
kerem 2026-02-26 04:34:03 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@addshore commented on GitHub (Mar 1, 2023):

Just wanted to say thanks for spending the time on this
The e2e tests on the application I use the dns-proxy-server on all pass with v3 now, and the next release will use v3!
https://gitlab.wikimedia.org/repos/releng/cli/-/merge_requests/330

<!-- gh-comment-id:1451025952 --> @addshore commented on GitHub (Mar 1, 2023): Just wanted to say thanks for spending the time on this The e2e tests on the application I use the dns-proxy-server on all pass with v3 now, and the next release will use v3! https://gitlab.wikimedia.org/repos/releng/cli/-/merge_requests/330
Author
Owner

@mageddo commented on GitHub (Mar 2, 2023):

You're welcome @addshore, thanks for helping with the acceptance tests

<!-- gh-comment-id:1451226614 --> @mageddo commented on GitHub (Mar 2, 2023): You're welcome @addshore, thanks for helping with the acceptance tests
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#105
No description provided.