Skip to content
Snippets Groups Projects
Commit 6c6fadd3 authored by nimrod's avatar nimrod
Browse files

- Added post about resovler.

parent 0b14a733
No related branches found
No related tags found
No related merge requests found
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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment