ruby 无法找到与“manpôwer.com”匹配的域名,尽管域名信息可用

f3temu5u  于 2023-04-11  发布在  Ruby
关注(0)|答案(1)|浏览(113)

我在使用whois gem时遇到了一个问题,因为它无法找到域名“manpôwer.com”的任何记录。

No match for "MANPôWER.COM".
>>> Last update of whois database: 2023-03-22T14:56:58Z <<<

我的理解是,gem依赖于Verisign数据库获取域信息,并且可以通过Verisign数据库或其他第三方网站找到此域。我使用的是最新版本的gem,不确定可能是什么问题。如有任何见解或帮助,将不胜感激。
谢谢大家。

irb(main):002:0> require 'whois'
=> true

irb(main):003:0> Gem.loaded_specs["whois"].version
=> #<Gem::Version "5.1.0">

irb(main):004:0> Whois.whois("manpôwer.com")
=> "No match for \"MANP\xC3\xB4WER.COM\".\r\n>>> Last update of whois database: 2023-03-22T15:25:36Z <<<\r\n\r\nNOTICE: The expiration date displayed in this record is the date the\r\nregistrar's sponsorship of the domain name registration in the registry is\r\ncurrently set to expire. This date does not necessarily reflect the expiration\r\ndate of the domain name registrant's agreement with the sponsoring\r\nregistrar.  Users may consult the sponsoring registrar's Whois database to\r\nview the registrar's reported date of expiration for this registration.\r\n\r\nTERMS OF USE: You are not authorized to access or query our Whois\r\ndatabase through the use of electronic processes that are high-volume and\r\nautomated except as reasonably necessary to register domain names or\r\nmodify existing registrations; the Data in VeriSign Global Registry\r\nServices' (\"VeriSign\") Whois database is provided by VeriSign for\r\ninformation purposes only, and to assist persons in obtaining information\r\nabout or related to a domain name registration record. VeriSign does not\r\nguarantee its accuracy. By submitting a Whois query, you agree to abide\r\nby the following terms of use: You agree that you may use this Data only\r\nfor lawful purposes and that under no circumstances will you use this Data\r\nto: (1) allow, enable, or otherwise support the transmission of mass\r\nunsolicited, commercial advertising or solicitations via e-mail, telephone,\r\nor facsimile; or (2) enable high volume, automated, electronic processes\r\nthat apply to VeriSign (or its computer systems). The compilation,\r\nrepackaging, dissemination or other use of this Data is expressly\r\nprohibited without the prior written consent of VeriSign. You agree not to\r\nuse electronic processes that are automated and high-volume to access or\r\nquery the Whois database except as reasonably necessary to register\r\ndomain names or modify existing registrations. VeriSign reserves the right\r\nto restrict your access to the Whois database in its sole discretion to ensure\r\noperational stability.  VeriSign may restrict or terminate your access to the\r\nWhois database for failure to abide by these terms of use. VeriSign\r\nreserves the right to modify these terms at any time.\r\n\r\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\r\nRegistrars.\r\n"
2j4z5cfb

2j4z5cfb1#

查询中的名称应该始终指定为Punycode。Unicode它只用于显示,从不用于网络调用(或者在本例中是whois查询)。
以下语句应产生预期结果:

Whois.whois("xn--manpwer-w0a.com")

要转换名称,您可以使用各种在线工具之一,如https://www.punycoder.com/。或者,如果您想在Ruby中编写转换脚本,请使用simpleidn gem

相关问题