bind-dns搭建
为啥要自己搭建dns
好玩儿学习方便用
安装
yum解决
yum install -y bind bind-utils
配置文件
/etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{
version}/Bv9ARM.html
options {
listen-on port 53 {
110.120.119.80; }; #自己的dnsip地址
listen-on-v6 port 53 {
::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query {
any; };
forwarders {
110.120.119.2; }; #网关
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large s

本文介绍了为何要自建DNS服务器,并详细阐述了使用bind-dns进行安装、配置文件编辑、权限设置以及如何添加Harbor解析的过程。在实际操作中,需要注意Harbor端口81的特殊解析问题,可通过曲线救国的方法,如利用nginx进行域名解析。当遇到DNS解析问题时,提供了排查方法。
最低0.47元/天 解锁文章





