Files
dns-serrvice/templates/query.html
T
AI Agent 0a18b94d84 feat: BIND DNS Web Manager - Web interface for managing BIND9 DNS server
- Flask + SQLite web app with user authentication
- Zone management: create/delete zones, edit raw zone files
- Record management: add/delete A/AAAA/CNAME/MX/TXT/NS/PTR/SRV/CAA records
- Service control: start/stop/restart/reload BIND via systemctl/rndc
- Configuration editor: edit named.conf.options/local with syntax validation
- DNS query testing: online dig tool
- Audit log: all operations logged with user/timestamp
- BIND9 backend, listening on port 53
2026-07-09 17:24:44 +08:00

58 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block title %}DNS 查询测试 - DNS{% endblock %}
{% block content %}
<div class="page-header">
<h1>DNS 查询测试</h1>
</div>
<div class="card">
<div class="card-body">
<form method="POST" class="form">
<div class="form-row">
<div class="form-group" style="flex:1">
<label>域名</label>
<input type="text" name="domain" placeholder="example.com" required
value="{{ result.domain if result else '' }}">
</div>
<div class="form-group">
<label>记录类型</label>
<select name="qtype" style="width:120px">
{% for t in qtypes %}
<option value="{{ t }}" {% if result and result.qtype == t %}selected{% endif %}>{{ t }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label>DNS 服务器</label>
<input type="text" name="server" placeholder="留空=本地:53"
value="{{ result.server if result else '' }}" style="width:200px">
</div>
<div class="form-group form-actions-vertical">
<button type="submit" class="btn btn-primary">🔍 查询</button>
</div>
</div>
<p class="form-hint">留空 DNS 服务器默认查询本地 BIND (127.0.0.1:53)</p>
</form>
</div>
</div>
{% if result %}
<div class="card">
<div class="card-header">
<h2>查询结果</h2>
<span class="badge {% if result.success %}badge-ok{% else %}badge-err{% endif %}">
{% if result.success %}成功{% else %}失败{% endif %}
</span>
</div>
<div class="card-body">
<div class="query-meta">
<span><strong>域名:</strong> {{ result.domain }}</span>
<span><strong>类型:</strong> {{ result.qtype }}</span>
<span><strong>服务器:</strong> {{ result.server }}</span>
</div>
<pre class="query-output">{{ result.output }}</pre>
</div>
</div>
{% endif %}
{% endblock %}