Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dns wildcarding #615

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aaronstillwell
Copy link

@aaronstillwell aaronstillwell commented Dec 19, 2021

This PR is an attempt at implementing DNS wildcard support. The use case in mind is for those of us who wish to use nebula's DNS in conjunction with virtual hosts.

At the moment, say we have a server my-server.nebula, it is not possible to use virtual hosts to have, for example multiple apps served at app-1.my-server.nebula, app-2.my-server.nebula etc.

This initial (naive) implementation can be enabled with the new config options as seen below.

# ...
lighthouse:
  # ...
  dns:
    # ...
    wildcard: true
    wildcard_limit: 5 # recursion limit used when searching for a matching host

This config is global and doesn't support per-host or per-group enabling. I welcome discussion on the proposed feature and its implementation as-is as well as commentary around the desired configuration of the feature.

Relevant slack discussion: https://nebulaoss.slack.com/archives/CRWJJM52B/p1639478617050700

@CLAassistant
Copy link

CLAassistant commented Dec 19, 2021

CLA assistant check
All committers have signed the CLA.

dns_server.go Outdated Show resolved Hide resolved
@wadey
Copy link
Member

wadey commented Dec 19, 2021

Can you update examples/config.yml with the new config options? (They can be commented out by default)

dns_server.go Outdated Show resolved Hide resolved
@tarrenj
Copy link

tarrenj commented Dec 21, 2021

Very excited for this feature!

Copy link

@jstasiak jstasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a Go person and not a member of the team but I had a quick look and it looks good to me. I would very much like to see this land as it's a feature I'd like to (be able to) use.

@@ -33,6 +33,8 @@ lighthouse:
# The DNS host defines the IP to bind the dns listener to. This also allows binding to the nebula node IP.
#host: 0.0.0.0
#port: 53
#wildcard: true # Enable wildcarding on hosts e.g allowing my-app.my-host.nebula to resolve to the IP for my-host.nebula
#wildcard_limit: 5 # Limit of number of possible subdomains
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rephrase this to something like # The maximum supported subdomain depth or something. "number of possible" subdomains sounds to me like it would limit the number of any level subdomains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants