Skip to content

Support IPv6 #228

@dragoangel

Description

@dragoangel

Currently IPv6 isn't supported by this module.

For example IP 2003:e8:7f1d:f600:: is listed on zen.spamhaus.org and to check if it is the case we can resolve next record: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.f.d.1.f.7.8.e.0.0.3.0.0.2.zen.spamhaus.org IN A which is expanded version of IPv6 requested in backward direction as any other IP RBL. as result we will get 127.0.0.11, but /prober?target=2003:e8:7f1d:f600:: will return luzilla_rbls_errors{rbl="zen.spamhaus.org"} 1, manually expanding IPv6 and querying exporter also doesn't works /prober?target=2003:00e8:7f1d:f600:0000:0000:0000:0000.

To support IPv6 we need:

  1. check user provided value if it is a valid IPv6
  2. if this is valid IPv6 we need expand IPv6 to it's full version
  3. if this is not valid IPv6 we need check if this is valid IPv4, and if this also not the case set an error for this target
  4. if this IPv6: remove all : as we don't need them, split IP to array by 1 char, invert order of array and join it back to string by .
  5. if this IPv4: split IP by . to array, invert over of array and join it back to string by .
  6. append . and rbl domain to the end of record and resolve it, profit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions