Is there any IPv6-capable "paranoid" DNS resolver like Net::DNS::Paranoid, except with support for IPv6?

I'm currently writing a "link preview" fetcher, using Mojo::UserAgent. As this preview fetcher mildly implies fetching user-generated and/or user-controlled links (even though the application is primarily for myself), I'm looking for something like LWPx::ParanoidAgent / LWP::UserAgent::Paranoid / HTTP::Tiny::Paranoid, but for Mojolicious.

I have already resolved (hah!) myself to writing Mojo::UserAgent::Paranoid, which delegates (as they all do) the DNS resolution to Net::DNS::Paranoid, a DNS resolver class that blocks hosts and IP addresses that are unlikely URLs for external services, especially localhost and other internal networks (192.168.*, 10.* and the multicast addresses).

This is all fine and good, if it weren't for IPv6. Net::DNS::Paranoid happily lets ::1 through, as the code mostly looks at IPv4 addresses and its DNS resolution also only speaks A records, not AAAA.

Simply adding ::1 (localhost in IPv6-speak) to the list of blocked hosts is a good start, but I would also want to block the multicast and link-local IPv6 addresses and some others. So, I'm mildly looking towards extending Net::DNS::Paranoid to also support IPv6, but maybe somebody has already done the work, or has links to an existing implementation in another language where I can crib the pitfalls and footguns from.


In reply to Net::DNS::Paranoid and IPv6 by Corion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.