|
Server IP : 192.168.23.10 / Your IP : 216.73.216.141 Web Server : Apache System : Linux echo.premieradvertising.com 5.14.0-362.8.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 7 14:54:22 EST 2023 x86_64 User : rrrallyteam ( 1049) PHP Version : 8.1.34 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF Directory (0755) : /home/../../usr/share/doc/perl-TimeDate/../lua/../libgexiv2/../python3-dns/examples/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
import sys
import trio
import dns.message
import dns.asyncquery
import dns.asyncresolver
async def main():
if len(sys.argv) > 1:
host = sys.argv[0]
else:
host = "www.dnspython.org"
q = dns.message.make_query(host, "A")
r = await dns.asyncquery.udp(q, "8.8.8.8")
print(r)
q = dns.message.make_query(host, "A")
r = await dns.asyncquery.tcp(q, "8.8.8.8")
print(r)
q = dns.message.make_query(host, "A")
r = await dns.asyncquery.tls(q, "8.8.8.8")
print(r)
a = await dns.asyncresolver.resolve(host, "A")
print(a.response)
zn = await dns.asyncresolver.zone_for_name(host)
print(zn)
answer = await dns.asyncresolver.resolve_at("8.8.8.8", "amazon.com", "NS")
print("The amazon.com nameservers are:")
for rr in answer:
print(rr.target)
if __name__ == "__main__":
trio.run(main)