{"id":21389352,"url":"https://github.com/isaced/swiftwhois","last_synced_at":"2025-07-13T15:33:09.813Z","repository":{"id":213370651,"uuid":"733806387","full_name":"isaced/SwiftWhois","owner":"isaced","description":"SwiftWhois is a Swift library for retrieving WHOIS information of domains.","archived":false,"fork":false,"pushed_at":"2023-12-24T03:52:46.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T12:59:21.156Z","etag":null,"topics":["swift","swift-package-manager","whois","whois-lookup"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaced.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-20T07:04:06.000Z","updated_at":"2024-04-10T18:52:58.000Z","dependencies_parsed_at":"2023-12-24T04:29:00.167Z","dependency_job_id":"7172a8aa-dc19-4ec6-81d8-eb0975f6dec7","html_url":"https://github.com/isaced/SwiftWhois","commit_stats":null,"previous_names":["isaced/swiftwhois"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FSwiftWhois","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FSwiftWhois/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FSwiftWhois/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaced%2FSwiftWhois/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaced","download_url":"https://codeload.github.com/isaced/SwiftWhois/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225896372,"owners_count":17541485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["swift","swift-package-manager","whois","whois-lookup"],"created_at":"2024-11-22T12:26:05.228Z","updated_at":"2024-11-22T12:26:05.746Z","avatar_url":"https://github.com/isaced.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftWhois \u003ca href=\"https://github.com/isaced/SwiftWhois/actions/workflows/test.yml\"\u003e\u003cimg src=\"https://github.com/isaced/SwiftWhois/actions/workflows/test.yml/badge.svg\"\u003e\u003c/a\u003e \u003ca href=\"https://swift.org/package-manager/\"\u003e\u003cimg src=\"https://img.shields.io/badge/SPM-supported-DE5C43.svg?style=flat\"\u003e\u003c/a\u003e \u003ca href=\"https://raw.githubusercontent.com/isaced/SwiftWhois/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-black\"\u003e\u003c/a\u003e\n\nSwiftWhois is a Swift package that provides a straightforward mechanism for querying Whois information using Apple's Network framework via [NWConnection](https://developer.apple.com/documentation/network/nwconnection). The package aims to abstract the complexity of network communication and parsing to give developers an easy way to implement Whois lookup functionality.\n\n## Features\n\n- [x] Automatically select WHOIS server, no need to specify the WHOIS server\n- [x] Structured WHOIS data, easy to use\n- [x] Async/await support\n- [x] Support for custom WHOIS server\n\n## Requirements\n\niOS 13.0+ / macOS 10.15+\n\n## Installation\n\n### SPM\n\n```swift\n.package(url: \"https://github.com/isaced/SwiftWhois.git\", from: \"0.0.1\")\n```\n\n## Usage\n\n### Basic\n\n```swift\nimport SwiftWhois\n\nlet result = SwiftWhois.lookup(domain: \"google.com\")\nprint(result.domainName) // google.com\nprint(result.registrar) // MarkMonitor, Inc.\nprint(result.nameServers) // [\"ns1.google.com\", \"ns2.google.com\", \"ns3.google.com\", \"ns4.google.com\"]\nprint(result.creationDate) // 1997-09-15T00:00:00Z\nprint(result.expirationDate) // 2028-09-14T00:00:00Z\nprint(result.updatedDate) // 2021-08-17T17:32:39Z\nprint(result.domainStatus) // [\"clientDeleteProhibited\", \"clientTransferProhibited\", ...]\nprint(result.raw) // Raw WHOIS data\n```\n\n### Custom WHOIS server\n\nUsually, you don't need to specify the WHOIS server, SwiftWhois will automatically select the WHOIS server for you. But if you want to specify the WHOIS server, you can do it like this:\n\n```swift\nSwiftWhois.lookup(domain: \"google.com\", server: \"whois.verisign-grs.com\")\n```\n\n## Principle\n\nSwiftWhois leverages NWConnection to perform network operations for Whois protocol interactions. It simplifies the process of fetching and interpreting Whois data, encapsulating the logic required to manage network connectivity and data handling.\n\n### How it works\n\n1. Server Discovery: Determines the appropriate Whois server for a given domain or IP address by querying `whois.iana.org` by default, unless an alternative Whois server is specified.\n2. Connection: Initiates an NWConnection to the determined Whois server, typically on port 43.\n   Query Assembly: Creates a properly formatted Whois query for the given domain or IP address based on the server's requirements.\n3. Dispatch: Sends the assembled query asynchronously to the Whois server and awaits a response.\n4. Reception \u0026 Parsing: Receives the server's response, which is a textual Whois record, and parses it to extract meaningful data into a structured representation.\n5. Closure: Completes the operation by delivering the parsed Whois information or an error, if encountered, then terminates the network connection.\n\n## TODO\n\n- [ ] WHOIS server cache (in-memory, for speed up)\n- [ ] More TLDs (Top-Level Domains) test and support\n\n## Contributing \u0026 Support\n\n- Any TLDs (Top-Level Domains) that are not supported, please open an [issue](https://github.com/isaced/SwiftWhois/issues/new) or [PR](https://github.com/isaced/SwiftWhois/pulls).\n- Any bugs or feature requests, please open an [issue](https://github.com/isaced/SwiftWhois/issues/new).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaced%2Fswiftwhois","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaced%2Fswiftwhois","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaced%2Fswiftwhois/lists"}