Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: PTR Record Lookup Fails
Description of the Problem:
The current implementation of the PTR record lookup does not function as expected. An additional field
~=name=<fqdn>
is added to the query deep in the codebase, which causes the PTR record search to be empty.Code Reference:
infoblox.go: line 119
Current Behavior:
When searching for a PTR record, the following query is generated:
This query does not return any results because of the additional
name~=
field, which does not align with how PTR records should be queried in Infoblox. And also name contains a reversed ipv4addr.Expected Behavior:
The following query works as expected and returns the correct PTR record:
Alternatively, adding an additional search parameter, such as
ipv4addr
, makes the query even more specific and reliable:Root Cause:
name
field in the current implementation includes an IP address in reverse order with an additional extension. This must be reversed and handled properly.ptrdname
directly is more aligned with Infoblox's API specification for PTR record lookups.ipv4addr
ensures precise matching when searching for a specific record.Example:
Proposed Solution:
name~=
for PTR record lookups.ptrdname
directly:ipv4addr
in the query:This pull request aims to improve the accuracy and reliability of PTR record lookups while aligning the implementation with Infoblox API best practices. Feedback is welcome!