IPv6 addresses are not formatted correctly

Issue #4 resolved
Anonymous created an issue

The attached patch should fix the issue by: printing in hex instead of decimal, dividing the address into 8 groups instead of 16.

Comments (2)

  1. Paul Chakravarti repo owner

    Patch applied and new version uploaded to PyPi, thanks.

    I didn't originally include any formatting for AAAA records as parsing IPv6 addresses is fairly complicated and probably best left to an external library.

    This patch doesn't handle embedded zero components in IPv6 addresses (::) and therefore doesn't print these canonically (i.e. google.com AAAA response should be 2a00:1450:4009:0806::1008 rather than 2a00:1450:4009:0806:0000:0000:0000:1008) but is is still better than a string of tuples.


  2. Log in to comment