{"id":13793101,"url":"https://github.com/phpWhois/phpWhois","last_synced_at":"2025-05-12T17:31:47.767Z","repository":{"id":18554984,"uuid":"21756648","full_name":"phpWhois/phpWhois","owner":"phpWhois","description":"phpWhois general repository","archived":false,"fork":false,"pushed_at":"2023-10-17T12:38:57.000Z","size":2221,"stargazers_count":312,"open_issues_count":92,"forks_count":195,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-05-17T07:42:07.864Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://phpwhois.pw","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jgthms/bulma","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpWhois.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"docs/ROADMAP.md","authors":null}},"created_at":"2014-07-12T01:15:46.000Z","updated_at":"2024-04-30T06:14:39.000Z","dependencies_parsed_at":"2024-01-20T18:04:02.923Z","dependency_job_id":null,"html_url":"https://github.com/phpWhois/phpWhois","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpWhois%2FphpWhois","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpWhois%2FphpWhois/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpWhois%2FphpWhois/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpWhois%2FphpWhois/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpWhois","download_url":"https://codeload.github.com/phpWhois/phpWhois/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225144934,"owners_count":17427894,"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":[],"created_at":"2024-08-03T22:01:21.985Z","updated_at":"2024-11-18T07:30:17.911Z","avatar_url":"https://github.com/phpWhois.png","language":"PHP","funding_links":[],"categories":["类库"],"sub_categories":["HTTP/网络通信"],"readme":"Introduction\n------------\n\nThis package contains a Whois (RFC954) library for PHP. It allows a PHP program to create a Whois object, and obtain the output of a whois query with the `lookup` function.\n\nThe response is an array containing, at least, an element 'rawdata', containing the raw output from the whois request.\n\nIn addition, if the domain belongs to a registrar for which a special handler exists, the special handler will parse the output and make additional elements available in the response. The keys of these additional elements are described in the file HANDLERS.md.\n\nIt fully supports IDNA (internationalized) domains names as\ndefined in RFC3490, RFC3491, RFC3492 and RFC3454.\n\nIt also supports ip/AS whois queries which are very useful to trace\nSPAM. You just only need to pass the doted quad ip address or the\nAS (Autonomus System) handle instead of the domain name. Limited,\nnon-recursive support for Referral Whois (RFC 1714/2167) is also\nprovided.\n\nRequirements\n------------\n\nphpWhois requires PHP 5.3 or better with OpenSSL support to work properly.\n\nWithout SSL support you will not be able to query domains which do not have a whois server but that have a https based whois.\n\nInstallation\n------------\n\n### Via composer\n\n#### Stable version\n\n`php composer.phar require \"phpwhois/phpwhois\":\"~4.0\"`\n\n#### Latest development version\n\n`php composer.phar require \"phpwhois/phpwhois\":\"dev-master\"`\n\n\nExample usage\n-------------\n\n(see `example.php`)\n```php\n// Load composer framework\nif (file_exists(__DIR__ . '/vendor/autoload.php')) {\n    require(__DIR__ . '/vendor/autoload.php');\n}\n\nuse phpWhois\\Whois;\n\n$whois = new Whois();\n$query = 'example.com';\n$result = $whois-\u003elookup($query,false);\necho \"\u003cpre\u003e\";\nprint_r($result);\necho \"\u003c/pre\u003e\";\n```\nIf you provide the domain name to query in UTF8, then you\nmust use:\n```php\n$result = $whois-\u003elookup($query);\n```\nIf the query string is not in UTF8 then it must be in\nISO-8859-1 or IDNA support will not work.\n\nWhat you can query\n------------------\n\nYou can use phpWhois to query domain names, ip addresses and\nother information like AS, i.e, both of the following examples\nwork:\n```php\nuse phpWhois\\Whois;\n$whois = new Whois();\n$result = $whois-\u003elookup('example.com');\n\n$whois = new Whois();\n$result = $whois-\u003elookup('62.97.102.115');\n\n$whois = new Whois();\n$result = $whois-\u003elookup('AS220');\n```\nUsing special whois server\n--------------------------\n\nSome registrars can give special access to registered whois gateways\nin order to have more fine control against abusing the whois services.\nThe currently known whois services that offer special acccess are:\n\n### ripe\n\n  The new ripe whois server software support some special parameters\n  that allow to pass the real client ip address. This feature is only\n  available to registered gateways. If you are registered you can use\n  this service when querying ripe ip addresses that way:\n  ```php\n  use phpWhois\\Whois;\n  $whois = new Whois();\n  $whois-\u003euseServer('uk','whois.ripe.net?-V{version},{ip} {query}');\n  $result = $whois-\u003elookup('62.97.102.115');\n  ```\n\n### whois.isoc.org.il\n  This server is also using the new ripe whois server software and\n  thus works the same way. If you are registered you can use this service\n  when querying `.il` domains that way:\n\n```php\nuse phpWhois\\Whois;\n$whois = new Whois();\n$whois-\u003euseServer('uk','whois.isoc.org.il?-V{version},{ip} {query}');\n$result = $whois-\u003elookup('example.co.uk');\n```\n\n### whois.nic.uk\n\n  They offer what they call WHOIS2 (see http://www.nominet.org.uk/go/whois2 )\n  to registered users (usually Nominet members) with a higher amount of\n  permited queries by hour. If you are registered you can use this service\n  when querying .uk domains that way:\n\n```php\nuse phpWhois\\Whois;\n$whois = new Whois();\n$whois-\u003euseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}');\n$result = $whois-\u003elookup('example.co.uk');\n```\n\nThis new feature also allows you to use a different whois server than\nthe preconfigured or discovered one by just calling whois-\u003euseServer\nand passing the tld and the server and args to use for the named tld.\nFor example you could use another whois server for `.au` domains that\ndoes not limit the number of requests (but provides no owner \ninformation) using this:\n```php\nuse phpWhois\\Whois;\n$whois = new Whois();\n$whois-\u003euseServer('au','whois-check.ausregistry.net.au');\n```\nor:\n```php\nuse phpWhois\\Whois;\n$whois = new Whois();\n$whois-\u003euseServer('be','whois.tucows.com');\n```\n\nto avoid the restrictions imposed by the `.be` whois server\n\nor:\n\n```php\nuse phpWhois\\Whois;\n$whois = new Whois();\n$whois-\u003euseServer('ip','whois.apnic.net');\n```\n\nto lookup an ip address at specific whois server (but loosing the\nability to get the results parsed by the appropiate handler)\n\n`useServer` can be called as many times as necessary. Please note that\nif there is a handler for that domain it will also be called but\nreturned data from the whois server may be different than the data\nexpected by the handler, and thus results could be different.\n\nGetting results faster\n----------------------\n\nIf you just want to know if a domain is registered or not but do not\ncare about getting the real owner information you can set:\n\n```php\n$whois-\u003edeepWhois = false;\n```\n\nthis will tell phpWhois to just query one whois server. For `.com`, `.net` and `.tv` domains and ip addresses this will prevent phpWhois to ask more\nthan one whois server, you will just know if the domain is registered\nor not and which is the registrar but not the owner information.\n\nUTF-8\n-----\n\nPHPWhois will assume that all whois servers return UTF-8 encoded output,\nif some whois server does not return UTF-8 data, you can include it in\nthe `NON_UTF8` array in `whois.servers.php`\n\nWorkflow of getting domain info\n-------------------------------\n\n1. Call method `phpWhois\\Whois::lookup()` with domain name as parameter\r\n2. If second parameter of method is **true** (default), phpWhois will try to convert the domain name to punycode\r\n3. If domain is not listed in predefined handlers (`WHOIS_SPECIAL` at `src/whois.servers.php`), try to query **[tld].whois-servers.net**. If it has ip address, assume that it is valid whois server\r\n4. Try to query found whois server or fill response array with `unknown()` method\n\nNotes \n-----\n\nThere is an extended class called `phpWhois\\Utils` which contains a\ndebugging function called `showObject()`, if you `showObject($result)`\nit will output the total layout of the returned object to the \nweb browser.\n\nThe latest version of the package and a demo script resides at \nhttps://github.com/phpWhois/phpWhois\n\nContributing\n---------------\n\nIf you want to add support for new TLD, extend functionality or\ncorrect a bug, feel free to create a new pull request at Github's\nrepository https://github.com/phpWhois/phpWhois\n\nCredits\n-------\n\nMark Jeftovic \u003cmarkjr@easydns.com\u003e\n\nDavid Saez Padros \u003cdavid@ols.es\u003e\n\nRoss Golder \u003cross@golder.org\u003e\n\nDmitry Lukashin \u003cdmitry@lukashin.ru\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FphpWhois%2FphpWhois","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FphpWhois%2FphpWhois","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FphpWhois%2FphpWhois/lists"}