Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit dd47a23

Browse files
author
MooCow
authored
Merge pull request #250 from maarten-boot/master
fix nameservers it
2 parents e385859 + b8013e3 commit dd47a23

File tree

24 files changed

+84
-21
lines changed

24 files changed

+84
-21
lines changed

testdata/example.com/nameservers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
example.com name server a.iana-servers.net.
2+
example.com name server b.iana-servers.net.

testdata/example.net/nameservers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
example.net name server b.iana-servers.net.
2+
example.net name server a.iana-servers.net.

testdata/example.org/input

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Name Server: a.iana-servers.net
5858
Name Server: b.iana-servers.net
5959
DNSSEC: signedDelegation
6060
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
61-
>>> Last update of WHOIS database: 2022-11-17T10:47:37Z <<<
61+
>>> Last update of WHOIS database: 2023-01-04T15:03:07Z <<<
6262

6363
For more information on Whois status codes, please visit https://icann.org/epp
6464

testdata/example.org/nameservers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
example.org name server b.iana-servers.net.
2+
example.org name server a.iana-servers.net.

testdata/google.com/input

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Tech Organization: Google LLC
3131
Tech State/Province: CA
3232
Tech Country: US
3333
Tech Email: Select Request Email Form at https://domains.markmonitor.com/whois/google.com
34-
Name Server: ns4.google.com
35-
Name Server: ns3.google.com
3634
Name Server: ns1.google.com
3735
Name Server: ns2.google.com
36+
Name Server: ns3.google.com
37+
Name Server: ns4.google.com
3838
DNSSEC: unsigned
3939
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
40-
>>> Last update of WHOIS database: 2022-11-17T22:52:22+0000 <<<
40+
>>> Last update of WHOIS database: 2023-01-04T14:55:04+0000 <<<
4141

4242
For more information on WHOIS status codes, please visit:
4343
https://www.icann.org/resources/pages/epp-status-codes

testdata/google.com/nameservers

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
google.com name server ns2.google.com.
2+
google.com name server ns4.google.com.
3+
google.com name server ns3.google.com.
4+
google.com name server ns1.google.com.

testdata/google.com/output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ statuses list ['clientDeleteProhibited (https://www.icann
1212
dnssec bool False
1313
name_servers list ['ns1.google.com', 'ns2.google.com', 'ns3.google.com', 'ns4.google.com']
1414
registrant str 'Google LLC'
15-
emails list ['[email protected]']
15+

testdata/make_testdata.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ getDomains()
1818
)
1919
}
2020

21+
verifyNameservers()
22+
{
23+
local str="$1"
24+
25+
grep name_servers "./$str/output" | awk '{ $1 = $2 = ""; print }' | awk -F, '{print NF}'
26+
grep "name server" "./$str/nameservers" | wc -l
27+
28+
}
2129
makeDataForDomain()
2230
{
2331
local str="$1"
@@ -32,6 +40,12 @@ makeDataForDomain()
3240
# dump the expected output as output
3341
../test2.py -d "$str" |
3442
tee "./$str/output"
43+
44+
# dump the nameservers via host
45+
host -t ns "$str" |
46+
tee "./$str/nameservers"
47+
48+
# verifyNameservers "$str"
3549
}
3650

3751
makeDataIfNotExist()
@@ -43,10 +57,22 @@ makeDataIfNotExist()
4357
done
4458
}
4559

60+
makeDataIfExist()
61+
{
62+
for str in ${DOMAINS[@]}
63+
do
64+
makeDataForDomain "$str"
65+
done
66+
}
67+
4668
main()
4769
{
70+
local force="$1"
4871
getDomains
4972
makeDataIfNotExist
73+
[ "$force" == "force" ] && {
74+
makeDataIfExist
75+
}
5076
}
5177

52-
main
78+
main $*

testdata/meta.co.jp/nameservers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
meta.co.jp name server ns2.meta.co.jp.
2+
meta.co.jp name server ns2.sphere.ad.jp.
3+
meta.co.jp name server ns.meta.co.jp.

testdata/meta.co.uk/input

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
c.ns.facebook.com
3232
d.ns.facebook.com
3333

34-
WHOIS lookup made at 10:47:38 17-Nov-2022
34+
WHOIS lookup made at 15:03:07 04-Jan-2023
3535

3636
--
3737
This WHOIS information is provided for free by Nominet UK the central registry
3838
for .uk domain names. This information and the .uk WHOIS are:
3939

40-
Copyright Nominet UK 1996 - 2022.
40+
Copyright Nominet UK 1996 - 2023.
4141

4242
You may not access the .uk WHOIS or use any data from it except as permitted
4343
by the terms of use available in full at https://www.nominet.uk/whoisterms,

0 commit comments

Comments
 (0)