26 lines
763 B
Python
26 lines
763 B
Python
from flask import Flask, render_template, request
|
|
import main as dnspy
|
|
app = Flask(__name__)
|
|
app.config['DEBUG'] = True
|
|
|
|
@app.route('/', methods=['POST', 'GET'])
|
|
def index():
|
|
if request.method == 'POST':
|
|
data = request.form['domain']
|
|
print(data)
|
|
dnsinfo, whois = dnspy.lookupDomain(str(data))
|
|
#dnsinfo = {"." : "."}
|
|
return render_template('dns.html', whois=whois, dnsinfo=dnsinfo)
|
|
else:
|
|
whois = {"Status" : "Please enter a domain"}
|
|
dnsinfo = {"Stub" : "Data"}
|
|
return render_template('dns.html', whois=whois, dnsinfo=dnsinfo)
|
|
|
|
@app.route('/domain/', methods=['POST', 'GET'])
|
|
def getDomain():
|
|
data = request.form['domain']
|
|
return data
|
|
|
|
if __name__ == '__main__':
|
|
app.run(host='0.0.0.0')
|