new file: client/dnssender.py new file: client/main.py new file: database/dns.db new file: database/initdb.py new file: server/main.py new file: server/xiaomiandns.py
13 lines
376 B
Python
13 lines
376 B
Python
import sqlite3
|
|
|
|
db_file = 'dns.db'
|
|
if __name__ == '__main__':
|
|
conn = sqlite3.connect(db_file)
|
|
cursor = conn.cursor()
|
|
try:
|
|
cursor.execute('''CREATE TABLE xiaomiandns(domain TEXT PRIMARY KEY, ip TEXT, pubkey TEXT)''')
|
|
except sqlite3.OperationalError:
|
|
print("table xiaomiandns already exists")
|
|
conn.commit()
|
|
cursor.close()
|
|
conn.close() |