Skip to content

Enable DNS Resolution #100

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hanno2003
Copy link

This pull request enhances the initIPBlocks function in plugin.go to support both CIDR block parsing and DNS resolution for input strings. This change increases the flexibility of the function by allowing it to handle domain names in addition to CIDR blocks.

Enhancements to initIPBlocks function:

  • The function now attempts to parse each input string as a CIDR block first. If parsing fails, it falls back to resolving the string as a domain name via DNS.
  • For resolved domain names, the function converts the resulting IP addresses into /32 (for IPv4) or /128 (for IPv6) CIDR networks before adding them to the list of IP networks.
  • Improved error handling ensures that meaningful error messages are returned when neither CIDR parsing nor DNS resolution succeeds.

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

Successfully merging this pull request may close these issues.

1 participant