All Projects → zanaca → docker-dns

zanaca / docker-dns

Licence: MIT license
DNS server for your docker containers. Allowing you to access them with a domain name, without exposing ANY port. Allowing access from you linux, mac or windows browser!

Programming Languages

python
139335 projects - #7 most used programming language
Smarty
1635 projects
Dockerfile
14818 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to docker-dns

dbt-spotify-analytics
Containerized end-to-end analytics of Spotify data using Python, dbt, Postgres, and Metabase
Stars: ✭ 92 (+22.67%)
Mutual labels:  docker-containers
reno
A thin, testable routing library designed to sit on top of Deno's standard HTTP module
Stars: ✭ 127 (+69.33%)
Mutual labels:  routing
Feliz.Router
A router component for React and Elmish that is focused, powerful and extremely easy to use.
Stars: ✭ 66 (-12%)
Mutual labels:  routing
bbbike
BBBike
Stars: ✭ 56 (-25.33%)
Mutual labels:  routing
lwip nat arduino
lwip library with NAT feature for Arduino environment
Stars: ✭ 55 (-26.67%)
Mutual labels:  routing
angular-lazy-loading
Angular 15 & React 18 Examples Lazy Loading
Stars: ✭ 39 (-48%)
Mutual labels:  routing
invalidroutesreporter
An ExaBGP process to elaborate and report/log invalid routes received by route servers.
Stars: ✭ 14 (-81.33%)
Mutual labels:  routing
Multiple-Vehicle-Routing
Simple MVR simulation
Stars: ✭ 27 (-64%)
Mutual labels:  routing
balanceofsatoshis
Tool for working with the balance of your satoshis on LND
Stars: ✭ 447 (+496%)
Mutual labels:  routing
path-to-regexp-php
PHP port of https://github.com/pillarjs/path-to-regexp
Stars: ✭ 21 (-72%)
Mutual labels:  routing
SymfonyModularRouting
[DEPRECATED] Decouple your Symfony routing to independent, standalone services.
Stars: ✭ 18 (-76%)
Mutual labels:  routing
rtrlib
An open-source C implementation of the RPKI/Router Protocol client
Stars: ✭ 62 (-17.33%)
Mutual labels:  routing
web-components-hooks-demo
web components hooks demo
Stars: ✭ 17 (-77.33%)
Mutual labels:  routing
node-match-path
Matches a URL against a path. Parameters, wildcards, RegExp.
Stars: ✭ 30 (-60%)
Mutual labels:  routing
valve-matchmaking-ip-ranges
Lists of locations & IP addresses of Valve servers
Stars: ✭ 69 (-8%)
Mutual labels:  routing
p4fpga
P4-14/16 Bluespec Compiler
Stars: ✭ 70 (-6.67%)
Mutual labels:  routing
psycopgr
A Python wrapper of pgRouting for routing from nodes to nodes on real map.
Stars: ✭ 24 (-68%)
Mutual labels:  routing
tunman
Comprehensive solution for SSH tunnels - respawning, healthchecking/monitoring
Stars: ✭ 43 (-42.67%)
Mutual labels:  routing
url-trailing-slash
Allows enforcing URL routes with or without trailing slash
Stars: ✭ 35 (-53.33%)
Mutual labels:  routing
vue-route-generator
Vue Router route config generator
Stars: ✭ 146 (+94.67%)
Mutual labels:  routing

Docker DNS for containers and host machine

Docker DNS creates a container that works as a DNS for docker containers in you machine. Every running container will be accessible by $container_name.docker for example. You could inform you own domain if you like. Your domains are available inside and outside docker, but just for you machine. For example, you could access http://nginx.docker from your browser window OR from inside a container.

It was created to allow you to work in a container as if was a "real" server setup. You will have access to all ports/services inside the container without need to expose all the ports. You can publish ports as well to access it like the old way. E.g.: 127.0.0.1:8080 -> container_ip:80

It was tested on linux and macOS Catalina. macOS environment has a downside that you will always run the ./bin/docker-dns tunnel every time you boot the host machine. An service will be installed and loaded on every boot to handle that necessity or you can run the application 'dockerdns-tunnel', available on ~/Applications.

The main usage is for development environment only, should not be used in production environment.

By default it will enable create that hosts: ns0.docker and ns0.$YOUR_HOSTNAME.docker.

Requirements for host machine

Tested enviroment

  • Docker 19.03.13
  • Ubuntu: 20.04
  • Linux Mint: 20, 20.1
  • macOS: Catalina, Big Sur
  • Windows: 10 (WSL2 - Ubuntu)

You can see a list of older OSes on version 1.x

On Windows you don't have to install Docker inside WSL2 linux, you should work with Docker for windows and enable WSL2 integration.

* Windows caveat

For Windows a socks5 proxy (using ssh to container ns0) will be used to handle the address from host machine to docker network. Only addresses from 172.16.0.0 to 172.31.255.255 will be redirect to proxy. You will not be able to run a different proxy while using docker-dns. The socks5 proxy address is 127.0.0.1 using port 31080

Install

For an simple installation process, paste the command in a macOS Terminal, Linux or WSL shell prompt.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/zanaca/docker-dns/install/run.sh)"
  • The script will place docker-dns inside /usr/local/docker-dns

Or you can checkout the code in any folder of your choice and:

  • Install all python dependencies by running $ pip3 install -r requirements.txt
  • Execute $ ./bin/docker-dns install

Supported commands

  • install - Set up all environment;

  • uninstall - Remove configuration files from your system;

  • show-domain - Show the working domain of your installation;

  • tunnel - Create a tunnel to route all traffic to you docker containers. Available only in macOS, on linux you don't need that feature;

  • status - Show the current status for your machine.

You can see the list of all available commands and options running $ ./bin/docker-dns -h

Options

On install command you can pass some variables to change how setup is done. You can change the working domain for example.

  • tld: working domain. It can be any domain name but the domains designed to work in loopback network. For example yourmachine.dev will create names like CONTAINER_NAME.yourmachine.dev. You can have docker.your_real_domain.com as well so it will create names like CONTAINER_NAME.docker.your_real_domain.com . Default value: docker`;

  • tag: Tag name for the created docker image. It should be changed only if you have a name conflict Default value: ns0;

  • name: Running container name. Default value: the tag value.

Example:

$ ./bin/docker-dns install tld=docker.dev tag=dns

Will create a docker image name dns and it will be available as dns.docker.dev so you could run dig www.google.com @dns.docker.dev

Troubleshooting

If you are using macOS or Windows, on restart, you can will loose access to your containers DNS. You need to recreate a tunnel to route all traffic to docker network through it on every boot. Just execute sudo ./bin/docker-dns tunnel from docker-dns folder

License

MIT

Thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].