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

Custom DNS records in addition to wildcard #6

Closed
wants to merge 3 commits into from

Conversation

science695
Copy link

@science695 science695 commented Apr 17, 2018

I'm using this bind container with devilbox, but I'm needing to run both apache/php-fpm, and another container running a ngingx (api-umbrella).

This feature would allow you to pass in an environment variable and specify other subdomains (under the $WILDCARD_DOMAIN) that go to different ip addresses (or even sub-subdomain wildcards: *.a.loc)

While being globally available, it should also work with devilbox.

Allows an Environment variable to add additional dns entries (before the wildcard address).

Allows greater flexibility for the bind dns server while allowing the simple configuration continue working.
Including documentation and example usage for adding in extra dns records via the CUSTOM_DNS env variable
science695 added a commit to science695/devilbox that referenced this pull request Apr 17, 2018
To make use of this new feature in the bind container (cytopia/docker-bind#6), this documents how to setup the CUSTOM_DNS environment variable.
science695 added a commit to science695/devilbox that referenced this pull request Apr 17, 2018
Mentioning the new feature for custom dns in the bind container (cytopia/docker-bind#6)
science695 added a commit to science695/devilbox that referenced this pull request Apr 17, 2018
Mentioning the new feature for custom dns in the bind container (cytopia/docker-bind#6)
@cytopia
Copy link
Owner

cytopia commented Apr 22, 2018

@science695 very good idea. I am currently looking into and thinking my head around it.

So far I think this solves a few issues and I will merge it.


One thing however I might change is the custom DNS to not use the currently chosen wildcard TLD, but rather be able to use any domain. I think that will give you more power/control overall.

So I will rewrite it afterwards to be able to specify the following:

EXTRA_HOSTS='test.de=1.2.3.4,test.org=some.dns.de,api.sub.com=2.3.4.5'

This will mean that

  1. test.de will be made available by IP: 1.2.3.4
  2. test.org will be available by whatever IP some.dns.de resolves to (also allows domains)
  3. api.sub.com will be made available by IP: 2.3.4.5

Being able to also map DNS names into your chosen DNS name will also allow you to make use of host.docker.internal DNS name, which always points to the IP address of your host computer from within a container.


Update:

This will also solve the problem accessing the host computer as described here: https://deliciousbrains.com/devilbox-local-wordpress-development-docker/#communicating-with-external-hosts


Thoughts on that?

@cytopia cytopia self-assigned this Apr 22, 2018
@science695
Copy link
Author

Does that mean you would add the ability to do cnames and other tags (instead of just A records)?

Something like:

EXTRA_HOSTS='special.host=CNAME=docker.localhost'

I'm not sure what docker does with ipv6, but that ^ functionality could open up ipv6. (The code in this request is only the ipv4 "A" record)

@cytopia
Copy link
Owner

cytopia commented Apr 23, 2018

Similar, you only need two values:

EXTRA_HOSTS='special.host=CNAME'

If the running container is able to resolve CNAME, it will add this record, if it cannot resolve it, it will skip it.

For extra hosts I will also make sure to add reverse DNS.

@cytopia
Copy link
Owner

cytopia commented Apr 24, 2018

@science695 I will close your PR in favour of a major rewrite: #8

Thanks a lot for this idea and your effort, unfortunately I could not merge yours, because of basically changing everything.

@cytopia cytopia closed this Apr 24, 2018
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.

None yet

2 participants