Instrument: BIND
BIND 9 Documentation (isc.org)
https://downloads.isc.org/isc/bind9/9.16.28/BIND9.16.28.x64.zip
named:
- 查看构建信息
named -V
named.conf
acl internal { 192.168.8.0/24; 127.0.0.0/8; };
options {
directory "c:/named/etc/zones";
allow-transfer { none; };
recursion no;
};
view internal {
match-clients { internal; };
allow-recursion { internal; };
zone "aegean.com" IN {
type master;
file "internal/aegean.com.zone";
allow-transfer { none; };
};
};
view external {
match-clients { any; };
zone "aegean.com" IN {
type master;
file "external/aegean.com.zone";
allow-transfer { none; };
};
};
key "rndc-key" {
algorithm hmac-sha256;
secret "K8fn06OR4vei2AJRUkfUyhwTWVbSZShp+hTNj/CrinY=";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
Windows:
https://clientarea.mochahost.com/knowledgebase/558?_m=knowledgebase&_a=viewarticle&kbarticleid=558
Compile:
# prerequisites
yum install centos-release-scl\*
yum install scl-utils\*
yum install devtoolset-10
scl enable devtoolset-10 bash
yum install -y libuv-devel libnghttp2-devel openssl-devel libcap-devel
# add user
groupadd --system --gid 53 named
useradd --system --no-create-home --shell /sbin/nologin --home-dir /usr/local/bind --uid 53 --gid named named
# compile
./configure --prefix=/usr/local/bind --sysconfdir=/etc/named --disable-chroot
make -j8 && make install
# post compile
cat > /etc/profile.d/named.sh <<EOF
export PATH=/usr/local/bind/sbin:/usr/local/bind/bin:$PATH
EOF
source /etc/profile.d/named.sh
mkdir /var/named/logs -pv
chown -R .named /var/named
chmod g+s /var/named
rndc-confgen > /etc/named/rndc.conf
tail -10 /etc/named/rndc.conf | head -9 | sed 's@#\ @@g' > /etc/named/named.conf
cat >> /etc/named/named.conf <<EOF
options {
// Working directory & files
directory "/var/named";
dump-file "logs/cache_dump.log";
statistics-file "logs/statistics.log";
memstatistics-file "logs/memstatistics.log";
recursing-file "logs/recursing.log";
// listen-on port 53 { 192.168.8.1; 127.0.0.1; }; listen-on-v6 { any; };
listen-on port 53 { any; };
// Do not allow access to cache
// allow-query-cache { none; };
pid-file "/run/named.pid";
// forwarders { 8.8.8.8; 8.8.4.4; };
recursion yes;
allow-recursion { any; };
// allow-query { 127.0.0.1/32; 192.168.0.0/16; };
allow-query { any; };
allow-transfer { none; };
notify yes;
version "alimentation amalgamation";
// max-cache-size 15m;
recursive-clients 200;
tcp-clients 200;
auth-nxdomain no; # yes, 则以权威性(authority)返回NXDOMAIN(域不存在), no, 不做权威性回答
// dnssec
// dnssec-validation yes | no | auto;
// forward
// forwarders { 8.8.8.8; 8.8.4.4; };
// forward first | only;
};
EOF
/usr/local/bind/sbin/named -u named -c /etc/named /named.conf
echo /usr/local/bind/lib > /etc/ld.so.conf.d/named.conf
ldconfig -v
ln -svnf /usr/local/bind/include /usr/include/named
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律