likexian / whois-parser

Whois parser for domain whois information parsing in Go(Golang).
Apache License 2.0
284 stars 86 forks source link

一个特殊的 IANA WHOIS 结果无法被正确处理 #82

Closed yb closed 4 months ago

yb commented 4 months ago

WHOIS 结果如下:

% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

domain:       SWISS

organisation: Swiss Confederation
address:      Federal Office of Communications (OFCOM)
address:      Rue de l'Avenir 44
address:      P.O Box
address:      Biel/Bienne BE CH-2501
address:      Switzerland

contact:      administrative
name:         .swiss TLD Administrative Contact
organisation: Federal Office of Communications (OFCOM)
address:      Rue de l'Avenir 44
address:      P.O Box
address:      Biel / Bienne BE CH-2501
address:      Switzerland
phone:        +41 58 461 89 49
fax-no:       +41 58 460 55 49
e-mail:       domainnames@bakom.admin.ch

contact:      technical
name:         .swiss TLD Technical Contact
organisation: CORE Association
address:      Cours de Rive 2
address:      Geneva CH-1204
address:      Switzerland
phone:        +41 22 312 5610
fax-no:       +41 22 312 5612
e-mail:       dnsmaster@corenic.org

nserver:      ANYCAST10.IRONDNS.NET 195.253.64.12 2a01:5b0:4:0:0:0:0:c
nserver:      ANYCAST23.IRONDNS.NET 195.253.65.11 2a01:5b0:5:0:0:0:0:b
nserver:      ANYCAST24.IRONDNS.NET 195.253.65.12 2a01:5b0:5:0:0:0:0:c
nserver:      ANYCAST9.IRONDNS.NET 195.253.64.11 2a01:5b0:4:0:0:0:0:b
nserver:      G.NIC.SWISS 195.253.64.9 2a01:5b0:4:0:0:0:0:9
nserver:      NS15.RCODE0.NET 194.0.25.15 2001:678:20:0:0:0:0:15
nserver:      U.NIC.SWISS 195.253.65.9 2a01:5b0:5:0:0:0:0:9
ds-rdata:     16056 10 2 b974351f3624a85d4304c09a005203d8cbd8ff0d790095413b19c31538f1ae31

whois:        whois.nic.swiss

status:       ACTIVE
remarks:      Registration information: http://www.nic.swiss

created:      2015-04-16
changed:      2022-01-07
source:       IANA

被解析成:

{
    "domain": {
        "name": "s@bakom.admin",
        "extension": "ch"
    }
}

猜测是跟这两个正则有关:

https://github.com/likexian/whois-parser/blob/f90678364cceea8f9f8ea17397231581fe681d60/parser.go#L248-L251

望能处理,非常感谢

likexian commented 4 months ago

Hello @yb Thanks for your feedback and coffee! This have beed fixed, please try the latest version.


If you think this repository is helpful, please share it with friends, thanks.