GithubHelp home page GithubHelp logo

docker-devdns's Introduction

docker-devdns

A Dockerized version of @robbiev's https://github.com/robbiev/devdns.

Usage

This image is based off of the google/golang image.

Run it on port 5300 and have it return 127.0.0.1 for every DNS request it gets:

$ docker run -p 5300:5300/udp robmadole/devdns:latest
2015/01/09 17:19:38 Listening on 0.0.0.0:5300, resolving to 127.0.0.1

Since DNS works on UDP make sure that you use /udp when making the port mapping.

Now we can query the DNS server with any domain and always get back a deterministic value.

$ dig -p 5300 mysite.dev @localhost

Or if you're using Boot2Docker:

$ dig -p 5300 mysite.dev @`boot2docker ip`

What next?

If you are using OS X you can create a file inside of /etc/resolver called dev and tell it to use your devdns container.

Tip use boot2docker ip to figure out what IP address you need to assign nameserver to if you are using Boot2Docker.

/etc/resolver/dev:

nameserver 192.168.59.103
port 5300

To change the IP address that it answers with use the ANSWER environment variable.

$ docker run -e ANSWER=10.9.8.7 -p 5300:5300/udp robmadole/devdns:latest
2015/01/09 18:13:08 Listening on 0.0.0.0:5300, resolving to 10.9.8.7

docker-devdns's People

Contributors

robmadole avatar

Watchers

 avatar  avatar

Forkers

ztory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.