From 955575f23269f37da1d3ff4ba4f47ae58354e598 Mon Sep 17 00:00:00 2001 From: Li Kexian Date: Fri, 28 Jun 2024 20:41:35 +0800 Subject: [PATCH] fixed for domain swiss --- parser.go | 6 ++-- testdata/noterror/README.md | 1 + testdata/noterror/swiss_swiss | 51 ++++++++++++++++++++++++++++++ testdata/noterror/swiss_swiss.json | 44 ++++++++++++++++++++++++++ testdata/noterror/swiss_swiss.pre | 43 +++++++++++++++++++++++++ 5 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 testdata/noterror/swiss_swiss create mode 100644 testdata/noterror/swiss_swiss.json create mode 100644 testdata/noterror/swiss_swiss.pre diff --git a/parser.go b/parser.go index f63786d..e051141 100644 --- a/parser.go +++ b/parser.go @@ -30,7 +30,7 @@ import ( // Version returns package version func Version() string { - return "1.24.17" + return "1.24.18" } // Author returns package author @@ -246,9 +246,9 @@ func parseContact(contact *Contact, name, value string) { } var searchDomainRx1 = regexp.MustCompile(`(?i)\[?domain\:?(\s*\_?name)?\]?[\s\.]*\:?` + - `\s*([^\s\,\;\(\)]+)\.([^\s\,\;\(\)\.]{2,})`) + `\s*([^\s\,\;\@\(\)]+)\.([^\s\,\;\(\)\.]{2,})`) var searchDomainRx2 = regexp.MustCompile(`(?i)\[?domain\:?(\s*\_?name)?\]?[\s\.]*\:?` + - `\s*([^\s\,\;\(\)\.]{2,})\n`) + `\s*([^\s\,\;\@\(\)\.]{2,})\n`) // searchDomain finds domain name and extension from whois information func searchDomain(text string) (name, extension string) { diff --git a/testdata/noterror/README.md b/testdata/noterror/README.md index 47abe87..2f9d3ea 100644 --- a/testdata/noterror/README.md +++ b/testdata/noterror/README.md @@ -15,6 +15,7 @@ If there is any problem, please feel free to open a new issue. | . | [cn](cn_cn) | [cn](cn_cn.json) | √ | | . | [com](com_com) | [com](com_com.json) | √ | | . | [google](google_google) | [google](google_google.json) | √ | +| . | [swiss](swiss_swiss) | [swiss](swiss_swiss.json) | √ | | .ac | [git.ac](ac_git.ac) | [git.ac](ac_git.ac.json) | √ | | .ac | [google.ac](ac_google.ac) | [google.ac](ac_google.ac.json) | √ | | .aero | [google.aero](aero_google.aero) | [google.aero](aero_google.aero.json) | √ | diff --git a/testdata/noterror/swiss_swiss b/testdata/noterror/swiss_swiss new file mode 100644 index 0000000..a31a6b4 --- /dev/null +++ b/testdata/noterror/swiss_swiss @@ -0,0 +1,51 @@ +% 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 diff --git a/testdata/noterror/swiss_swiss.json b/testdata/noterror/swiss_swiss.json new file mode 100644 index 0000000..feac7d0 --- /dev/null +++ b/testdata/noterror/swiss_swiss.json @@ -0,0 +1,44 @@ +{ + "domain": { + "domain": "swiss", + "punycode": "swiss", + "name": "swiss", + "whois_server": "whois.nic.swiss", + "status": [ + "active" + ], + "name_servers": [ + "anycast10.irondns.net", + "anycast23.irondns.net", + "anycast24.irondns.net", + "anycast9.irondns.net", + "g.nic.swiss", + "ns15.rcode0.net", + "u.nic.swiss" + ], + "created_date": "2015-04-16", + "created_date_in_time": "2015-04-16T00:00:00Z", + "updated_date": "2022-01-07", + "updated_date_in_time": "2022-01-07T00:00:00Z" + }, + "registrant": { + "organization": "Swiss Confederation", + "street": "Federal Office of Communications (OFCOM), Rue de l'Avenir 44, P.O Box, Biel/Bienne BE CH-2501, Switzerland" + }, + "administrative": { + "name": ".swiss TLD Administrative Contact", + "organization": "Federal Office of Communications (OFCOM)", + "street": "Rue de l'Avenir 44, P.O Box, Biel / Bienne BE CH-2501, Switzerland", + "phone": "+41 58 461 89 49", + "fax": "+41 58 460 55 49", + "email": "domainnames@bakom.admin.ch" + }, + "technical": { + "name": ".swiss TLD Technical Contact", + "organization": "CORE Association", + "street": "Cours de Rive 2, Geneva CH-1204, Switzerland", + "phone": "+41 22 312 5610", + "fax": "+41 22 312 5612", + "email": "dnsmaster@corenic.org" + } +} \ No newline at end of file diff --git a/testdata/noterror/swiss_swiss.pre b/testdata/noterror/swiss_swiss.pre new file mode 100644 index 0000000..d722794 --- /dev/null +++ b/testdata/noterror/swiss_swiss.pre @@ -0,0 +1,43 @@ +% IANA WHOIS server +% for more information on IANA, visit http://www.iana.org +% This query returned 1 object +domain: SWISS +registrant organisation: Swiss Confederation +registrant address: Federal Office of Communications (OFCOM) +registrant address: Rue de l'Avenir 44 +registrant address: P.O Box +registrant address: Biel/Bienne BE CH-2501 +registrant address: Switzerland +contact: administrative +administrative name: .swiss TLD Administrative Contact +administrative organisation: Federal Office of Communications (OFCOM) +administrative address: Rue de l'Avenir 44 +administrative address: P.O Box +administrative address: Biel / Bienne BE CH-2501 +administrative address: Switzerland +administrative phone: +41 58 461 89 49 +administrative fax-no: +41 58 460 55 49 +administrative e-mail: domainnames@bakom.admin.ch +contact: technical +technical name: .swiss TLD Technical Contact +technical organisation: CORE Association +technical address: Cours de Rive 2 +technical address: Geneva CH-1204 +technical address: Switzerland +technical phone: +41 22 312 5610 +technical fax-no: +41 22 312 5612 +technical 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 \ No newline at end of file