Skip to content

Commit

Permalink
fixed for domain swiss
Browse files Browse the repository at this point in the history
  • Loading branch information
likexian committed Jun 28, 2024
1 parent daf1e0c commit 955575f
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

// Version returns package version
func Version() string {
return "1.24.17"
return "1.24.18"
}

// Author returns package author
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions testdata/noterror/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
51 changes: 51 additions & 0 deletions testdata/noterror/swiss_swiss
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions testdata/noterror/swiss_swiss.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
43 changes: 43 additions & 0 deletions testdata/noterror/swiss_swiss.pre
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 955575f

Please sign in to comment.