

Dnsdiff - jgrahamc
https://github.com/joshenders/dnsdiff

======
verelo
Having worked in the hosting industry on many migration projects, my
experience is that tools like this get scripted up from scratch far too often,
resulting in bugs and many other issues that should never have existed. Thanks
for sharing this!

One question that springs to mind: does this handle round robin DNS entries?
With things like Alias records at Amazon becoming more common, and other pre-
existing round robin setups out there, i could see those being important to
consider. I would test it myself now but i need to hit bed for the night :-)
If no one answers i'll post the answer when I get to test it out.

~~~
joshenders
It should handle round robin DNS entries just fine but happy to update it if
you find an issue.

~~~
joshenders
I spoke too soon, I'll have an update shortly that addresses this and a few
other issues I've noticed. Thanks for the feedback!

------
dwb
Nice work. It would be even better if the author packaged it properly so the
dependency is installed along with it :)

Ruby projects are always gems, Haskell projects always have a Cabal
definition, and Node projects are always available in NPM – but so often I see
Python scripts or libraries that don't have a setup.py and friends. The state
of Python packaging is a bit of a mess still, granted, but it's not difficult.
The guide is here:
[https://packaging.python.org/](https://packaging.python.org/)

------
fanf2
See also [http://dotat.at/prog/nsdiff/](http://dotat.at/prog/nsdiff/) which
outputs the differences between two versions of a zone as an bs update script.
We use it at Cambridge University for pushing changes from our IP Register
database into the DNSSEC signing server.

------
jbn
It's a little odd to write:

    
    
               if color_enabled:
                    print(added(r2.answer, color=True))
               else:
                    print(added(r2.answer))
    

wouldn't you rather write:

    
    
           print(added(r2.answer, color=color_enabled))
    

after adjusting color_enabled to be None or True?

~~~
joshenders
Yeah, I end up doing essentially this in the most recent version.

------
_paulc
If you have dnslib installed
([https://pypi.python.org/pypi/dnslib](https://pypi.python.org/pypi/dnslib))
you can also do something like:

    
    
      python3.4 -m dnslib.client --server <ns1> --diff <ns2> <domain> <type>

~~~
joshenders
Nice!

------
pcthrowaway
can someone explain how this provides an advantage over using dig and diff?

~~~
acdha
Check out the logic:

[https://github.com/joshenders/dnsdiff/blob/master/dnsdiff#L1...](https://github.com/joshenders/dnsdiff/blob/master/dnsdiff#L135)

If you use dig and a text diff, you'll see more noise for lines which have
been reordered, omitted, etc. This approach provides better output, making it
easier to read and decreasing the odds of operator error – which is always a
good thing but particularly so for something as important as DNS.

