This file is indexed.

/usr/share/doc/python3-dns/examples/named-perf.py is in python3-dns 3.1.1-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python3

servers = [ "192.92.129.1",
    "192.189.54.17", # yarrina
    "192.189.54.33", # warrane
    "203.8.183.1",   # yalumba
    "192.189.54.65", # gnamma 
    "128.250.1.21",  # munnari

      ]

lookups = [ ( 'munnari.oz.au', 'A' ),
    ( 'connect.com.au', 'SOA' ),
    ( 'parc.xerox.com', 'MX' ),
    ( 'bogus.example.net', 'A'),
    ]

rpts = 5

def main():
    import DNS
    import socket
    import time
    res = {}
    for server in servers:
        res[server] = [100000,0,0,0] # min,max,tot,failed
    for what,querytype in lookups:
        for count in range(rpts):
            for server in servers:
                d = DNS.DnsRequest(server=server,timeout=1)
                fail = 0
                timingstart = time.time()
                try:
                    r=d.req(name=what,qtype=querytype)
                except DNS.Error:
                    fail = 1
                timingfinish = time.time()
                if fail:
                    res[server][3] =  res[server][3] + 1
                    print("(failed)",res[server][3])
                if 0:
                    if r.header['ancount'] == 0:
                        print("WARNING: Server",server,"got no answers for", \
                            what, querytype)
                    t = int(1000 * (timingfinish - timingstart))
                    print(server,"took",t,"ms for",what,querytype)
                    res[server][0] = min(t,res[server][0])
                    res[server][1] = max(t,res[server][1])
                    res[server][2] = res[server][2] + t
    for server in servers:
        queries = rpts * len(lookups)
        r = res[server]
        print(server)
        print("%-30s %2d/%2d(%3.2f%%) %dms/%dms/%dms min/avg/max" % (
            socket.gethostbyaddr(server)[0], 
            queries - r[3], queries, 
            ((queries-r[3])*100.0)/queries,
            r[0],
            r[2] / queries,
            r[1]))

if __name__ == "__main__":
    main()