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

Handling Errors When Spaceship.com’s WHOIS Server is Unreachable #22

Open
QuietJoon opened this issue Oct 7, 2024 · 1 comment
Open

Comments

@QuietJoon
Copy link

QuietJoon commented Oct 7, 2024

Hello,

I’ve been encountering errors with the WHOIS client when querying domains registered through Spaceship.com's and/or Porkbun's WHOIS server. It seems the client fails to handle cases where Spaceship.com’s WHOIS server is unreachable or returns an unexpected response. Here are the error messages I’ve received:

an error occurred while querying the whois server (domain=mujun.cafe, servers=[]): whois: connect to whois server failed: dial tcp: address tcp///www.spaceship.com/domains/whois: unknown port
Error: Failed to retrieve data for domain 'mujun.cafe'.

an error occurred while querying the whois server (domain=namu.systems, servers=[]): whois: connect to whois server failed: dial tcp: address tcp///www.spaceship.com/domains/whois: unknown port
Error: Failed to retrieve data for domain 'namu.systems'.

an error occurred while querying the whois server (domain=namu.works, servers=[]): whois: connect to whois server failed: dial tcp: address tcp///www.spaceship.com/domains/whois: unknown port
Error: Failed to retrieve data for domain 'namu.works'.

I understand that the root cause is an issue with Spaceship.com’s and/or Porkbun WHOIS server, and not a fault of your whois client per se. However, I believe it would be beneficial if the client could handle such scenarios more gracefully.

I tried Specifiable whois server to query option, but because it have query limit (I haven't tried yet, but I handles about 40 domains, it may reaches limit)

Preferred Behavior

  • (I have no idea why interacting with some WHOIS servers fails, but) Covers some irregular WHOIS server.
  • Provide weak whois server specification option. Try default(?) whois server first, but when fails tries with given/specified whois server.

Steps to Reproduce:

1.	Use the WHOIS client to query any domain registered with Spaceship.com (e.g., `whois monopole.center`).
2.	Observe the error message regarding failure to connect to the WHOIS server. (maybe port isssue?)

Environment:

•	WHOIS client version: [v0.0.5]

Thank you for your consideration.
Your work really helps me.

@QuietJoon
Copy link
Author

Now I'm using this as my suggested behavior by this wrapping script to cover failure

whois_server=whois.iana.org

# Run 'whoisx' with JSON output and capture it
json_output=$(whoisx -j "$domain_name")

# Handle cases where 'whoisx' fails or returns empty output
if [ -z "$json_output" ]; then
    json_output=$(whoisx -j "$domain_name" "$whois_server")
    if [ -z "$json_output" ]; then        
        echo "Error: Failed to retrieve data for domain '$domain_name'."
        exit 1
    fi
fi

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

No branches or pull requests

1 participant