INTGRTNS-500-Fix-external-nameserver-ip-resolution-in-createNameserversArray#545
Open
avishka-ra wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes APITools::createNameserversArray() so that IP resolution is only required for true glue records (NS hostnames that are a child of the domain being processed). External nameservers are now passed to the OpenProvider API with only their hostname, instead of being silently dropped when no IP could be resolved. The change affects domain registration, transfer, and "save nameservers" flows.
Changes:
- Add a glue-record check (
str_ends_withagainstsld.tld) and short-circuit external NS entries to be sent without IP resolution. - Keep the existing IP-resolution chain (params →
searchNsRequest/getNameserverList→gethostbyname) only for glue records, and throw/aggregate clearer errors when resolution fails. - Update user-facing error messages and replace the
$invalidNameServerflag with an$invalidGlueNameServerslist.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a1410ca to
21b9b5b
Compare
prasad-fernando-74
approved these changes
May 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this fixes
Closes #525.
createNameserversArray()was attempting to resolve an IP for every nameserver before including it in the request. For external nameservers (Cloudflare, Sectigo, OP's own NS, etc.) this is unnecessary — the OP API only requires a hostname for these. The IP lookup would silently drop any NS it couldn't resolve, causing operations to fail or proceed with an incomplete nameserver set.What changed
The function now checks whether each NS is a glue record (i.e. the NS hostname is a child of the domain being processed —
ns1.abc.comforabc.com) before doing any IP resolution.searchNsRequest, thengethostbyname(). If no IP can be found, a clear exception is thrown.Affects domain registration, transfer, and save nameservers — all three call this method.