-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ASNLookup code and documentation #1257
Conversation
253b4da
to
0fc52ef
Compare
This is a breaking change, isn't it? Then it should be |
lib/Zonemaster/Engine/Profile.pm
Outdated
For C<"Cymru">, the strings are domain names. For C<"RIPE">, they are whois servers. Normally only the first | ||
item in the list will be used, the rest are backups in case the previous ones didn't work. | ||
|
||
Default C<{Cymru: [ "asnlookup.zonemaster.net", "asn.cymru.com" ]}>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current implementation, at least for Cymru style, only the first in the list is used. If a service has been completely removed then NXDOMAIN is returned, which is hard to distinguish from valid NXDOMAIN. Only for Cymru style the default value is included. For both I think it is better to refer the default value to to the default profile.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand what you mean. Do you suggest having the full default value from the profile instead, i.e.:
Default C<{Cymru: [ "asnlookup.zonemaster.net", "asn.cymru.com" ], RIPE: [ "riswhois.ripe.net" ] }>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, at least in Cymru style the second in the list will never be used as far as I can see. I suggest that it documented, and that the second is removed (also in profile.json and profile.yaml.
My suggestion was that the doumentation in the Perl module does not list the defaults, but instead refer to the default profile, but that is not what we do in other cases.
But then it should be documented that riswhois.ripe.net
is the default value if RIPE style is chosen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion was that the doumentation in the Perl module does not list the defaults, but instead refer to the default profile, but that is not what we do in other cases.
But then it should be documented that
riswhois.ripe.net
is the default value if RIPE style is chosen.
Updated to: Default C<{Cymru: [ "asnlookup.zonemaster.net", "asn.cymru.com" ], RIPE: [ "riswhois.ripe.net" ] }>
In the current implementation, at least for Cymru style, only the first in the list is used. If a service has been completely removed then NXDOMAIN is returned, which is hard to distinguish from valid NXDOMAIN. Only for Cymru style the default value is included. For both I think it is better to refer the default value to to the default
profile.json
.
Just to clarify, at least in Cymru style the second in the list will never be used as far as I can see. I suggest that it documented, and that the second is removed (also in profile.json and profile.yaml.
I think we should probably update this part of the specification then, so that instead it reads something like:
5. If there is no response (timeout) or the DNS response does not have
the RCODE "NOERROR", output *[ERROR_ASN_DATABASE]* and
end these steps for Cymru look-up of the specific IP address.
6. If the DNS response contains an empty answer section, output
*[EMPTY_ASN_SET]* and end these steps for Cymru look-up of the specific
IP address.
What do you think?
Is that an update of documentation only, or functional update? |
Documentation only. I have updated the description. |
I created asnlookup.dufberg.se, which has a DNAME to asnlookup.zonemaster.net:
When I change to the asnlookup.dufberg.se Zonemaster, with this PR, will not do the lookup.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No support for CNAME.
So it seems that the recursive lookup function of Zonemaster does not follow CNAMEs. It stops at the first satisfying response. I can update that but a lot of unit tests will break (due to missing data). But updating that data will also make a lot of them break, because some zones will have changed. |
9128434
to
0bc6bcd
Compare
I opened #1288 as to not overload this PR. I also rebased this PR on top of it. |
0bc6bcd
to
49e2420
Compare
These unit tests are now fixed (in #1288). I rebased again on the latest commit of this PR. |
Done in commit d807920. Message tag is ASN_LOOKUP_SOURCE, untranslated and with one argument. |
@matsduf @mattias-p please (re-)review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thought I found a couple of nits looking through this again.
- Update documentation - Update unit test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
Release testing passed with no errors. |
Purpose
This PR is four-fold:
asnroots
asn_db.style
andasn_db.sources
Context
Fixes #1255, #1052, #1053, #835
Also follows up on #1311 (comment)
Requires #1288
Changes
Zonemaster::Engine::ASNLookup->_cymru_asn_lookup()
ASN_LOOKUP_SOURCE
(withlevel = DEBUG
,module = System
andtestcase = Connectivity{03,04}
)Zonemaster::Engine::ASNLookup
asnroots
profile propertyHow to test this PR
Tests should pass.
Manual testing:
fake.asnlookup.zonemaster.net
andasnlookup.dufberg.se
in the default profile (or just create a new one):