Skip to content

a simple client to observe dns pollution network situation under The Great Firewall of China.

License

Notifications You must be signed in to change notification settings

xavierskip/dns-observe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

publish PyPI version

dns-observe

a simple client to observe dns pollution network situation under The Great Firewall of China.

So far, only type A DNS queries have been implemented.

Installing

Install and update using pip: pip install dns-observe

usage

cli

> dns-observe -h
usage: dns-observe [-h] [-s DNS_SERVER] [-t LISTEN_TIME] [-v] domain

Observing DNS pollution

positional arguments:
  domain                query domain

options:
  -h, --help            show this help message and exit
  -s DNS_SERVER, --dns_server DNS_SERVER
                        DNS server (default: 1.1.1.1)
  -t LISTEN_TIME, --listen_time LISTEN_TIME
                        listen time (default: 5)
  -v, --version         show program's version number and exit

python:

> python -m dns_observe api.openai.com

from dns_observe import DNSQuery, RecordType
dns = DNSQuery('1.1.1.1')
dns.query('api.openai.com')
dns.query('claude.ai', RecordType.AAAA)

output:

- Time: 2024-11-22 11:18:16.977688, Name: api.openai.com, TTL: 153, A: 103.56.16.112
- Time: 2024-11-22 11:18:16.978715, Name: api.openai.com, TTL: 206, A: 192.133.77.145
┌ Time: 2024-11-22 11:18:17.140652, Name: api.openai.com, TTL: 46, A: 162.159.140.245
└ Time: 2024-11-22 11:18:17.140652, Name: api.openai.com, TTL: 46, A: 172.66.0.243

How to Packaging Python Projects

https://packaging.python.org/en/latest/tutorials/packaging-projects/

python -m build

# testpypi
py -m twine upload --repository testpypi dist/*

# pypi
py -m twine upload dist/*

dev

> pip install -e .

test

> python tests/test_run.py

About

a simple client to observe dns pollution network situation under The Great Firewall of China.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages