0a18b94d84
- 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
91 lines
3.2 KiB
HTML
91 lines
3.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}配置管理 - DNS{% endblock %}
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1>BIND 配置管理</h1>
|
|
</div>
|
|
|
|
<div class="config-status {% if config_ok %}config-ok{% else %}config-err{% endif %}">
|
|
<span class="config-icon">{% if config_ok %}✅{% else %}❌{% endif %}</span>
|
|
<span>配置检查: {% if config_ok %}通过{% else %}有错误{% endif %}</span>
|
|
{% if not config_ok %}
|
|
<pre class="config-error">{{ config_msg }}</pre>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>named.conf (主配置)</h2>
|
|
<span class="text-muted text-sm">只读</span>
|
|
</div>
|
|
<div class="card-body">
|
|
<pre class="config-viewer">{{ main_content }}</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>named.conf.options (选项配置)</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="POST" action="{{ url_for('config_options_save') }}">
|
|
<div class="form-group">
|
|
<textarea name="content" class="code-editor" rows="20" spellcheck="false">{{ options_content }}</textarea>
|
|
</div>
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">💾 保存并重载</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2>named.conf.local (本地区域配置)</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="POST" action="{{ url_for('config_local_save') }}">
|
|
<div class="form-group">
|
|
<textarea name="content" class="code-editor" rows="20" spellcheck="false">{{ local_content }}</textarea>
|
|
</div>
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">💾 保存并重载</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header"><h2>配置说明</h2></div>
|
|
<div class="card-body">
|
|
<table class="table">
|
|
<thead>
|
|
<tr><th>配置文件</th><th>用途</th><th>路径</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><strong>named.conf</strong></td>
|
|
<td>主配置,包含其他配置文件</td>
|
|
<td class="text-mono text-sm">/etc/bind/named.conf</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>named.conf.options</strong></td>
|
|
<td>全局选项: 监听端口/地址、转发器、查询权限等</td>
|
|
<td class="text-mono text-sm">/etc/bind/named.conf.options</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>named.conf.local</strong></td>
|
|
<td>区域(zone)声明 - 由 Web UI 自动管理</td>
|
|
<td class="text-mono text-sm">/etc/bind/named.conf.local</td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong>zone files</strong></td>
|
|
<td>DNS 记录文件</td>
|
|
<td class="text-mono text-sm">/etc/bind/zones/db.*</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|