[GH-ISSUE #545] Stub Solver #184

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

Originally created by @mageddo on GitHub (Aug 27, 2024).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/545

Summary & Motivation

  • Create a basic local solver without the need of an additional config file.
  • Be a local, offline, out of the box suitable alternative for nip.io and sslip.io

Alternatives

Local Solver DB feature can be used, I consider the only difference is that you will need to create the DNS records config file previously.

Description

A new solver will be created

  • Named Stub because the hostname itself has the information it needs, then this solver is working as an adapter.
  • Only hostnames with a specific hostname name suffix will match to Stub solver
  • A configuration will be created to configure the hostname to match
  • If none is configured, .docker will be used
  • The solvers priority order will be: SolverSystem, SolverStub, SolverDocker, SolverLocalDB, SolverRemote
  • New Docs will be created to learn how to use the solver.

Without the need of create a DNS record file, satisfy the following usecases:

1. Offline solution

No internet dependency, no confidential information will be exposed as DPS will be running locally and don´t expose information to the internet.

2. Gain a domain where you can't use IPs directly

3. Be able to assign different certificate to every domain name using a same IP

you can’t register SSL certificates directly to an IP address so you can’t register a different certificate against your server’s IP address. [1]

4. No need of previous DNS record registration

You won't need to create a DNS record previously as in LocalSolverDB, it can be usefull in some cases

5. Memorability and Readability

A domain name like myapp.192.168.1.100.acme.com is easier to recognize, search and share compared to just an IP address. [1]

References

Requested at #544

Inspired on

nip.io

nip.io maps [.-].nip.io in "dot", "dash" or "hexadecimal" notation to the corresponding :

dot notation: magic.127.0.0.1.nip.io
dash notation: magic-127-0-0-1.nip.io
hexadecimal notation: magic-7f000001.nip.io

The "dash" and "hexadecimal" notation is especially useful when using services like LetsEncrypt as it's just a regular sub-domain of nip.io

sslip.io

Like nip.io plus it's supports ipv6

Changes (Optional)

  • Algoritmo de extrção do IP do hostname
  • Criar docs
  • Expor configuração do domínio a ser utilizado
  • Ligar o solver respeitando a prioridade

Algoritmo de extrção do IP do hostname

OK - Forma 1

Ler de trás pra frente até que o texto seja ou deixe de ser um ip

Forma 2

Obs: Não implementei pois a forma 1 é mais simples e já resolveu os usecases, se necessário posso criar um strategy que usa as várias formas.

  • Ler a string de trás pra frente e ler todo o texto até mudar o separador
  • Caso hexadecimal: se o separador não mudar e a palavra tiver 4 bytes ou mais, é um endereço em hexadecimal
Originally created by @mageddo on GitHub (Aug 27, 2024). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/545 ## Summary & Motivation * Create a basic local solver without the need of an additional config file. * Be a local, offline, out of the box suitable alternative for [nip.io](http://nip.io) and [sslip.io](http://sslip.io) ## Alternatives [Local Solver DB][3] feature can be used, I consider the only difference is that you will need to create the DNS records config file previously. ## Description **A new solver will be created** * Named **Stub** because the hostname itself has the information it needs, then this solver is working as an adapter. * Only hostnames with a specific hostname name suffix will match to Stub solver * A configuration will be created to configure the hostname to match * If none is configured, `.docker` will be used * The solvers priority order will be: SolverSystem, **SolverStub**, SolverDocker, SolverLocalDB, SolverRemote * New Docs will be created to learn how to use the solver. **Without the need of create a DNS record file, satisfy the following usecases:** ### 1. Offline solution No internet dependency, no confidential information will be exposed as DPS will be running locally and don´t expose information to the internet. ### 2. Gain a domain where you can't use IPs directly ### 3. Be able to assign different certificate to every domain name using a same IP > you can’t register SSL certificates directly to an IP address so you can’t register a different certificate against your server’s IP address. [[1][1]] ### 4. No need of previous DNS record registration You won't need to create a DNS record previously as in LocalSolverDB, it can be usefull in some cases ### 5. Memorability and Readability A domain name like `myapp.192.168.1.100.acme.com` is easier to recognize, search and share compared to just an IP address. [[1][2]] ## References Requested at #544 Inspired on ### nip.io > [nip.io](https://nip.io/) maps <anything>[.-]<IP Address>.nip.io in "dot", "dash" or "hexadecimal" notation to the corresponding <IP Address>: ``` dot notation: magic.127.0.0.1.nip.io dash notation: magic-127-0-0-1.nip.io hexadecimal notation: magic-7f000001.nip.io ``` > The "dash" and "hexadecimal" notation is especially useful when using services like [LetsEncrypt](https://letsencrypt.org/) as it's just a regular sub-domain of [nip.io](https://nip.io/) ### sslip.io Like nip.io plus it's supports ipv6 ## Changes (Optional) * [x] Algoritmo de extrção do IP do hostname * [x] Criar docs * [x] Expor configuração do domínio a ser utilizado * [x] Ligar o solver respeitando a prioridade ### Algoritmo de extrção do IP do hostname #### OK - Forma 1 Ler de trás pra frente até que o texto seja ou deixe de ser um ip #### Forma 2 **Obs**: Não implementei pois a forma 1 é mais simples e já resolveu os usecases, se necessário posso criar um strategy que usa as várias formas. * Ler a string de trás pra frente e ler todo o texto até mudar o separador * Caso hexadecimal: se o separador não mudar e a palavra tiver 4 bytes ou mais, é um endereço em hexadecimal [1]: https://nickjanetakis.com/blog/ngrok-lvhme-nipio-a-trilogy-for-local-development-and-testing [2]: https://chatgpt.com/share/dda21372-dd57-4f49-b8b7-7c6e7ee0f903 [3]: https://mageddo.github.io/dns-proxy-server/latest/en/2-features/local-entries/
kerem 2026-02-26 04:34:19 +03:00
  • closed this issue
  • added the
    feature
    label
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#184
No description provided.