Skip to content
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

Carry on if the record can't be cached #19800

Merged

Conversation

zeroSteiner
Copy link
Contributor

@zeroSteiner zeroSteiner commented Jan 10, 2025

This fixes an exception when a custom DNS resolver is used that was preventing SRV records from resolving correctly. Only some records can be cached by DNS, and if a record that isn't compatible is added to the cache, an exception is raised. The caller should ignore the exception if they have the answer they require and just continue with it.

def cache_record(record)

This came up while using the functionality added in #18446 that uses DNS to lookup SRV records. SRV records can't be cached and the exception was preventing the data from being returned at all.

Testing Steps

  • Setup a custom DNS server, this should be the default with Metasploit now but double check with dns
  • Run through the steps outlined in Make the DomainControllerRhost optional #18446 and see that the KDC can be automatically found with DNS instead of failing to resolve even though the DNS queries are made just fine as can be confirmed by wireshark

@adfoster-r7 adfoster-r7 merged commit 9c98804 into rapid7:master Jan 15, 2025
33 of 36 checks passed
@adfoster-r7 adfoster-r7 added the rn-fix release notes fix label Jan 15, 2025
@adfoster-r7
Copy link
Contributor

Release Notes

Fixes an exception when a custom DNS resolver is used that was preventing SRV records from resolving correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants