Commit 6c6fadd3 authored by nimrod's avatar nimrod
Browse files

- Added post about resovler.

parent 0b14a733
Loading
Loading
Loading
Loading

content/resolver.rst

0 → 100644
+42 −0
Original line number Diff line number Diff line
Testing DNS with a clean cache
##############################

:date: 2016-11-01
:summary: Testing DNS with a clean cache

Every so often I make changes to a DNS record, test it, find out it's wrong, fix
it and still get the old response because of caching somewhere along the line.
After it happened to me and a colleague during a launch of a new version of a
website, I decided to address the issue. I wanted a way to test DNS quickly and
easily (preferably locally on command line), for it to be lightweight, doesn't
require changes to my existing setup and doesn't require learning new tools. I
decided to create a Docker image that has its own DNS resolver and each new
container from that image has a clean cache and doesn't depend on other DNS
servers or is affected from their caching.

Usage
-----

To create a new container:

.. code:: shell

    docker run -it adarnimrod/resolver

Inside the container you have access to :code:`nslookup`, :code:`dig` and 
:code:`mail` for testing purposes. If you need to test new changes,
:code:`exit` the container and create a new one with no cache.

If you want to run just a single command (like getting the MX record for
:code:`shore.co.il`):

.. code:: shell

    docker run adarnimrod/resovler dig +short shore.co.il mx

How does it work
----------------

On launch, the container runs and uses its own DNS resolver (in this case NSD).
This way the OS caching or upstream caching interferes with querying and every
new container starts with a clean slate.