✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server.blackpussy.asia ​🇻​♯➤ 5.14.0-611.20.1.el9_7.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 163.245.207.76 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗞 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ mail,mb_send_mail
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /usr/share/doc/python3-dns/examples//doh-json.py
#!/usr/bin/env python3

import copy
import json
import httpx

import dns.flags
import dns.message
import dns.resolver
import dns.rdataclass
import dns.rdatatype

# This shows how to convert to/from dnspython's message object and the
# DNS-over-HTTPS (DoH) JSON form used by Google and Cloudflare, and
# described here:
#
#     https://developers.google.com/speed/public-dns/docs/doh/json
#
# There's no need to do this for DoH as dnspython supports the
# standard RFC 8484 protocol which all DoH providers implement.  The
# conversion to/from JSON is useful, however, so we show a way to do
# it.
#
# "simple" below means "simple python data types", i.e. things made of
# combinations of dictionaries, lists, strings, and numbers.


def make_rr(simple, rdata):
    csimple = copy.copy(simple)
    csimple["data"] = rdata.to_text()
    return csimple


def flatten_rrset(rrs):
    simple = {
        "name": str(rrs.name),
        "type": rrs.rdtype,
    }
    if len(rrs) > 0:
        simple["TTL"] = rrs.ttl
        return [make_rr(simple, rdata) for rdata in rrs]
    else:
        return [simple]


def to_doh_simple(message):
    simple = {"Status": message.rcode()}
    for f in dns.flags.Flag:
        if f != dns.flags.Flag.AA and f != dns.flags.Flag.QR:
            # DoH JSON doesn't need AA and omits it.  DoH JSON is only
            # used in replies so the QR flag is implied.
            simple[f.name] = (message.flags & f) != 0
    for i, s in enumerate(message.sections):
        k = dns.message.MessageSection.to_text(i).title()
        simple[k] = []
        for rrs in s:
            simple[k].extend(flatten_rrset(rrs))
    # we don't encode the ecs_client_subnet field
    return simple


def from_doh_simple(simple, add_qr=False):
    message = dns.message.QueryMessage()
    flags = 0
    for f in dns.flags.Flag:
        if simple.get(f.name, False):
            flags |= f
    if add_qr:  # QR is implied
        flags |= dns.flags.QR
    message.flags = flags
    message.set_rcode(simple.get("Status", 0))
    for i, sn in enumerate(dns.message.MessageSection):
        rr_list = simple.get(sn.name.title(), [])
        for rr in rr_list:
            rdtype = dns.rdatatype.RdataType(rr["type"])
            rrs = message.find_rrset(
                i,
                dns.name.from_text(rr["name"]),
                dns.rdataclass.IN,
                rdtype,
                create=True,
            )
            if "data" in rr:
                rrs.add(
                    dns.rdata.from_text(dns.rdataclass.IN, rdtype, rr["data"]),
                    rr.get("TTL", 0),
                )
    # we don't decode the ecs_client_subnet field
    return message


a = dns.resolver.resolve("www.dnspython.org", "a")
p = to_doh_simple(a.response)
print(json.dumps(p, indent=4))
response = httpx.get(
    "https://dns.google/resolve?",
    verify=True,
    params={"name": "www.dnspython.org", "type": 1},
)
p = json.loads(response.text)
m = from_doh_simple(p, True)
print(m)

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
17 Jan 2026 3.15 PM
root / root
0755
async_dns.py
0.854 KB
18 Feb 2024 6.35 PM
root / root
0644
ddns.py
1.166 KB
18 Feb 2024 6.35 PM
root / root
0644
ddr.py
0.928 KB
18 Feb 2024 6.35 PM
root / root
0644
doh-json.py
2.931 KB
18 Feb 2024 6.35 PM
root / root
0644
doh.py
0.521 KB
18 Feb 2024 6.35 PM
root / root
0644
doq.py
3.069 KB
18 Feb 2024 6.35 PM
root / root
0644
e164.py
0.112 KB
18 Feb 2024 6.35 PM
root / root
0644
ecs.py
0.439 KB
18 Feb 2024 6.35 PM
root / root
0644
edns.py
1.698 KB
18 Feb 2024 6.35 PM
root / root
0644
edns_resolver.py
1.496 KB
18 Feb 2024 6.35 PM
root / root
0644
mx.py
0.185 KB
18 Feb 2024 6.35 PM
root / root
0644
name.py
0.348 KB
18 Feb 2024 6.35 PM
root / root
0644
query_specific.py
1.616 KB
18 Feb 2024 6.35 PM
root / root
0644
receive_notify.py
0.998 KB
18 Feb 2024 6.35 PM
root / root
0644
reverse.py
1.356 KB
18 Feb 2024 6.35 PM
root / root
0644
reverse_name.py
0.137 KB
18 Feb 2024 6.35 PM
root / root
0644
send_notify.py
2.404 KB
18 Feb 2024 6.35 PM
root / root
0644
wire_read_tcp.py
1.62 KB
18 Feb 2024 6.35 PM
root / root
0644
xfr.py
0.332 KB
18 Feb 2024 6.35 PM
root / root
0644
zonediff.py
11.888 KB
18 Feb 2024 6.35 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF