嫩模是什么意思| 同样的药为什么价格相差很多| 上嘴唇发白是因为什么原因| 耳朵老是痒是什么原因| 丁香泡水喝有什么功效和作用| 什么是otc| 骨髓瘤是什么病| 腊梅什么时候开花| 眼压高有什么症状和危害| 原子序数等于什么| 多莉是什么鱼| 太岁是什么东西| 斐乐手表属于什么档次| 什么鱼红烧好吃| b超是查什么的| 摇花手是什么意思| 什么叫黑科技| 2月15日是什么星座| 什么什么的沙滩| 其可以组什么词| 心脏供血不足吃什么| 55岁属什么| 肝的主要功能是什么| 2月2号是什么星座| 契丹族现在是什么族| ivd是什么意思| 鹿晗和邓超什么关系| 为什么左手会发麻| 嘴唇紫色是什么原因| 说笑了是什么意思| 白案是什么意思| 取环后需要注意什么| ppl是什么药| 晚上睡不着觉吃什么药| poa是什么意思| 性生活是什么意思| 心情烦躁吃什么药| 什么牌子的冰箱最好| 为什么总是犯困想睡觉| 做腹腔镜手术后需要注意什么| 石英表不走了是什么原因| 什么菜可以隔夜吃| mk是什么牌子| 奶奶的弟弟叫什么| 股票roe是什么意思| 6月26日是什么星座| 唇红是什么原因| 孕妇为什么要左侧睡不能右侧睡| hvp是什么病毒| 胯骨在什么位置| 鸽子拉水便是什么原因| 大生化检查都包括什么项目| 乙肝表面抗体阴性什么意思| 当兵苦到什么程度| act什么意思| 什么时候锻炼身体最佳时间| 什么什么有味| aml是什么意思| 丹青指什么| 一直咳嗽不见好是什么原因| 缺血灶是什么意思| 排卵期之后是什么期| 睡觉手麻木是什么原因| 车加昆念什么| 12月14号是什么星座| 阴阳两虚用什么药| 唐氏筛查都查些什么| 八月十一号是什么星座| 桂花像什么| 枸杞子和什么泡水喝补肾壮阳| 血液属于什么组织| 子宫内膜为什么会增厚| hbcab阳性是什么意思| 刻板是什么意思| 什么是微量元素| 什么面条好吃| 小便不利是什么意思| 隔空是什么意思| 鼻子干燥吃什么中成药| 西米是什么做成的| 囊肿有什么症状| 虚热是什么意思| 泌尿外科主要检查什么| 海参什么样的好| 朋友妻不可欺是什么意思| 色弱是什么意思| 海豹油有什么作用| 什么是快捷支付| 南极有什么| 暨怎么读什么意思| 咂嘴是什么意思| 做梦梦见僵尸是什么预兆| 陈旧性骨折是什么意思| 金银花什么时候开花| 清明节的习俗有什么| 有什么别有病| 识大体是什么意思| 香蕉皮擦脸有什么作用与功效| 红曲是什么| 自相矛盾是什么意思| 什么饭不能吃| 脂肪最终被消化成什么| 病人打白蛋白意味着什么| 孕妇梦见自己出轨是什么意思| 休克的本质是什么| 施华洛世奇算什么档次| 黑色柳丁是什么意思| 三杯鸡的三杯是什么| 09年是什么年| 中位生存期什么意思| 同事过生日送什么礼物| 受孕是什么意思| 什么水适合婴儿冲奶粉| 鲥鱼是什么鱼| 子宫前位和子宫后位有什么区别| 竹马是什么意思| 血糖高适合吃什么蔬菜| 触媒是什么意思| 瓜子脸适合什么发型| 今年养殖什么最挣钱| 做穿刺是什么意思| 紫薇什么意思| 氯胺酮是什么| 淀粉酶高有什么危害| 吃什么去肝火最快| 返祖现象什么意思| 缺钾吃什么水果| 一片哗然是什么意思| eps是什么意思| 柳州有什么大学| 咖啡加什么最好喝| 刮宫后能吃什么水果| 嫡长子是什么意思| 大佐是什么军衔| 什么布料| by是什么意思| 重丧是什么意思| 拉肚子想吐是什么原因| 英红九号红茶什么档次| 胆结石是什么原因导致的| msm是什么药| bf是什么| o型血和ab型血生的孩子是什么血型| 德艺双馨是什么意思| 梦见打群架是什么意思| 氟斑牙是什么原因造成的| 藿香正气胶囊治什么病| 艮什么意思| 黑玫瑰代表什么| 中央候补委员是什么级别| 滥竽充数的滥是什么意思| 舌苔厚吃什么药| 晚上睡觉腿酸难受是什么原因| 一什么牌子| 祖马龙香水什么档次| 腹泻吃什么水果| 上将是什么级别| 今天过生日是什么星座| 浠字五行属什么| 碱性土壤适合种植什么| 什么样的人容易得脑瘤| 三月六号是什么星座| 连号的钱为什么不能花| offer是什么意思| 豌豆的什么不能吃| 刚怀孕要吃些什么好| 失眠吃什么食物最有效| 鸦片鱼又叫什么鱼| 路的尽头是什么| 怀孕吃核桃对宝宝有什么好处| 拉肚子是什么原因| 牙龈发炎肿痛吃什么药| 猫咪拉稀吃什么药| 梦见买碗是什么意思| 什么是烂尾楼| 手麻挂什么科室| 外阴有白色的东西是什么| 更年期什么年龄开始| 猴子怕什么| 松鼠的尾巴有什么作用| 梦见鼻子出血是什么意思| 1972属什么| 27岁属相是什么生肖| 鱼腥味是什么妇科病| 拔了智齿需要注意什么| 无量寿经讲的是什么| 家里养什么花最好| 量程是什么| 什么是口腔溃疡| 亢是什么意思| 跳蚤怕什么| 百岁老人叫什么| 牛油果吃了有什么好处| 韶关有什么特产| 吃什么东西补铁| 属猴的是什么命| 1974属什么| 肩胛骨缝疼吃什么药| 生辰纲是什么东西| 右肺上叶为什么恶性多| 5.16是什么星座| 寄居蟹喜欢吃什么| 西京医院什么科室最强| 山楂干泡水喝有什么功效和作用| 执拗是什么意思| 27属什么| 凉拌菜用什么醋最好| 肝阳上亢吃什么中成药| 音什么笑什么成语| 风湿吃什么药好| 吃力不讨好是什么意思| 为什么筋膜炎一躺下才会疼| 补体是什么| 什么是素数| 脚底板发黄是什么原因| 脱脂棉是什么| 闰月什么意思| 便秘吃什么药| 中国的国菜是什么| 钙片什么时候吃好| 什么时候期末考试| 硬下疳是什么样子| 平光镜是什么意思| 饱和脂肪是什么| 锅贴是什么| 90年属什么| 流口水是什么病的前兆| 月经正常颜色是什么色| 妈妈像什么| 喉咙痛头痛吃什么药| 治便秘吃什么| 吃什么升白细胞比较快| 紫癜病是什么病| 旱魃是什么| 广东广西以什么为界| 宽宽的什么填空| 米索前列醇片是什么药| 四季花是什么花| 猫砂是什么材料做的| 肝囊肿是什么病| 斗破苍穹什么时候出的| 七月18日是什么星座| 无语凝噎是什么意思| 什么人不适合去高原| 香奶奶是什么牌子| 今年阴历是什么年| 杀阴虱用什么药最快| 胖大海和什么搭配最好| 脖子大是什么原因| 天门冬氨酸氨基转移酶是什么| 7月29日什么星座| 闺蜜过生日送什么礼物好| 夏天吃什么降火| 今年二十岁属什么生肖| 坏垣是什么意思| 第三代身份证什么时候开始办理| 舌裂是什么原因造成的| 金牛座女和什么座最配对| 鼠目寸光是什么生肖| 激素是什么意思| 牙齿发软是什么原因| 生肖猴和什么生肖相冲| 人授和试管有什么区别| 腿肿吃什么药消肿最快最有效| 百度
Table of Contents
1. Install BIND
2. Configure the Main BIND File (named.conf.options)
3. Set Up a Forward Zone (Domain to IP)
a. Add Zone in named.conf.local (Ubuntu) or named.conf (CentOS)
b. Create the Zone File
4. (Optional) Set Up a Reverse Zone (IP to Domain)
a. Add Reverse Zone
b. Create Reverse Zone File
5. Test Configuration and Restart BIND
6. Test the DNS Server
Final Notes
Home System Tutorial LINUX How to Set Up a DNS Server on Linux Using BIND

山东协和学院2016年护士资格证领取时间及地点

Aug 03, 2025 pm 12:11 PM

百度 从火力上看,科罗拉多号拥有两个直径超过2米的新型导弹发射筒,每个发射筒不仅可以装载6枚战斧巡航导弹,还实现了多样化技术拓展,能容纳未来的新型导弹系统。

Install BIND using the package manager (apt for Ubuntu/Debian, dnf for CentOS/RHEL). 2. Configure global options in named.conf.options or named.conf to allow queries, set forwarders (like 8.8.8.8), enable recursion, and listen on all interfaces. 3. Set up a forward zone by adding a zone entry in named.conf.local (Ubuntu) or named.conf (CentOS) and create a zone file (e.g., db.example.local) with SOA, NS, and A records mapping hostnames to IPs. 4. Optionally, configure a reverse zone for PTR records by defining the reverse zone in the config and creating a corresponding reverse zone file (e.g., db.192.168.1). 5. Test configuration syntax with named-checkconf and validate zone files with named-checkzone, then restart the BIND service (bind9 on Ubuntu, named on CentOS) and enable it at boot. 6. Test DNS resolution using dig or nslookup for both forward and reverse lookups, and update client DNS settings to point to the new server; ensure zone serials are incremented on changes and use rndc reload to apply updates without full restart, while securing the server against open resolution and monitoring logs appropriately.

How to Set Up a DNS Server on Linux Using BIND

Setting up a DNS server on Linux using BIND (Berkeley Internet Name Domain) is a common task for managing internal network resolution or hosting domain names. BIND is the most widely used DNS software on Unix-like systems. Here’s how to set it up step by step on a typical Linux distribution like Ubuntu or CentOS.

How to Set Up a DNS Server on Linux Using BIND

1. Install BIND

First, install the BIND package using your distribution’s package manager.

On Ubuntu/Debian:

How to Set Up a DNS Server on Linux Using BIND
sudo apt update
sudo apt install bind9 bind9utils bind9-doc

On CentOS/RHEL/Rocky Linux:

sudo dnf install bind bind-utils -y

After installation, the main configuration files are usually located in /etc/bind/ (Debian/Ubuntu) or /etc/named.conf (RHEL-based).

How to Set Up a DNS Server on Linux Using BIND

2. Configure the Main BIND File (named.conf.options)

Edit the global options file to define how your DNS server behaves.

On Ubuntu:

sudo nano /etc/bind/named.conf.options

On CentOS:

sudo nano /etc/named.conf

Add or modify the options block to allow queries and set forwarders (e.g., Google’s DNS):

options {
    directory "/var/cache/bind";

    // Allow queries from your local network
    allow-query { localhost; 192.168.1.0/24; };

    // Forward DNS queries to external servers
    forwarders {
        8.8.8.8;
        8.8.4.4;
    };

    // Enable recursion
    recursion yes;

    // Disable DNSSEC for simplicity (optional)
    dnssec-validation no;

    // Listen on all interfaces
    listen-on-v6 { any; };
    listen-on { any; };
};

Replace 192.168.1.0/24 with your actual network subnet.


3. Set Up a Forward Zone (Domain to IP)

This allows your DNS server to resolve a domain name (e.g., example.local) to an internal IP.

a. Add Zone in named.conf.local (Ubuntu) or named.conf (CentOS)

On Ubuntu:

sudo nano /etc/bind/named.conf.local

Add:

zone "example.local" {
    type master;
    file "/etc/bind/db.example.local";
};

On CentOS: Add the same block in /etc/named.conf inside the appropriate section.

b. Create the Zone File

Copy the default zone template:

sudo cp /etc/bind/db.local /etc/bind/db.example.local

Edit the new file:

sudo nano /etc/bind/db.example.local

Update it like this:

$TTL    604800
@       IN      SOA     ns1.example.local. admin.example.local. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.example.local.
@       IN      A       192.168.1.10
ns1     IN      A       192.168.1.10
www     IN      A       192.168.1.20
mail    IN      A       192.168.1.30
  • Replace IPs as needed.
  • The @ represents the domain itself.
  • The email admin.example.local. corresponds to admin@example.local (note the trailing dot).

4. (Optional) Set Up a Reverse Zone (IP to Domain)

This allows reverse DNS lookups (PTR records).

a. Add Reverse Zone

In named.conf.local (Ubuntu) or named.conf (CentOS):

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/db.192.168.1";
};

b. Create Reverse Zone File

sudo cp /etc/bind/db.127 /etc/bind/db.192.168.1
sudo nano /etc/bind/db.192.168.1

Edit:

$TTL    604800
@       IN      SOA     ns1.example.local. admin.example.local. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.example.local.
10      IN      PTR     ns1.example.local.
20      IN      PTR     www.example.local.
30      IN      PTR     mail.example.local.

This maps IPs like 192.168.1.10ns1.example.local.


5. Test Configuration and Restart BIND

Check for syntax errors:

sudo named-checkconf

Check zone files:

sudo named-checkzone example.local /etc/bind/db.example.local
sudo named-checkzone 1.168.192.in-addr.arpa /etc/bind/db.192.168.1

If all is good, restart BIND:

Ubuntu:

sudo systemctl restart bind9

CentOS:

sudo systemctl restart named

Enable on boot:

sudo systemctl enable bind9    # or named

6. Test the DNS Server

Use dig or nslookup to verify:

dig @localhost example.local
dig @localhost www.example.local
dig -x 192.168.1.20

You should see correct A or PTR records.

Also, update your client machines to use this server as their DNS (e.g., set DNS to 192.168.1.10 in network settings).


Final Notes

  • Keep serial numbers updated (increment them) when changing zone files.
  • Use rndc reload to reload zones without restarting:
    sudo rndc reload example.local
  • Secure your DNS server: avoid open resolvers, use ACLs, and monitor logs in /var/log/syslog or /var/log/messages.
  • Basically, that’s it — you now have a working authoritative and recursive DNS server using BIND on Linux. It’s not complicated, but attention to syntax and permissions matters.

    The above is the detailed content of How to Set Up a DNS Server on Linux Using BIND. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72
Install LXC (Linux Containers) in RHEL, Rocky & AlmaLinux Install LXC (Linux Containers) in RHEL, Rocky & AlmaLinux Jul 05, 2025 am 09:25 AM

LXD is described as the next-generation container and virtual machine manager that offers an immersive for Linux systems running inside containers or as virtual machines. It provides images for an inordinate number of Linux distributions with support

7 Ways to Speed Up Firefox Browser in Linux Desktop 7 Ways to Speed Up Firefox Browser in Linux Desktop Jul 04, 2025 am 09:18 AM

Firefox browser is the default browser for most modern Linux distributions such as Ubuntu, Mint, and Fedora. Initially, its performance might be impressive, however, with the passage of time, you might notice that your browser is not as fast and resp

How to troubleshoot DNS issues on a Linux machine? How to troubleshoot DNS issues on a Linux machine? Jul 07, 2025 am 12:35 AM

When encountering DNS problems, first check the /etc/resolv.conf file to see if the correct nameserver is configured; secondly, you can manually add public DNS such as 8.8.8.8 for testing; then use nslookup and dig commands to verify whether DNS resolution is normal. If these tools are not installed, you can first install the dnsutils or bind-utils package; then check the systemd-resolved service status and configuration file /etc/systemd/resolved.conf, and set DNS and FallbackDNS as needed and restart the service; finally check the network interface status and firewall rules, confirm that port 53 is not

How would you debug a server that is slow or has high memory usage? How would you debug a server that is slow or has high memory usage? Jul 06, 2025 am 12:02 AM

If you find that the server is running slowly or the memory usage is too high, you should check the cause before operating. First, you need to check the system resource usage, use top, htop, free-h, iostat, ss-antp and other commands to check CPU, memory, disk I/O and network connections; secondly, analyze specific process problems, and track the behavior of high-occupancy processes through tools such as ps, jstack, strace; then check logs and monitoring data, view OOM records, exception requests, slow queries and other clues; finally, targeted processing is carried out based on common reasons such as memory leaks, connection pool exhaustion, cache failure storms, and timing task conflicts, optimize code logic, set up a timeout retry mechanism, add current limit fuses, and regularly pressure measurement and evaluation resources.

Install Guacamole for Remote Linux/Windows Access in Ubuntu Install Guacamole for Remote Linux/Windows Access in Ubuntu Jul 08, 2025 am 09:58 AM

As a system administrator, you may find yourself (today or in the future) working in an environment where Windows and Linux coexist. It is no secret that some big companies prefer (or have to) run some of their production services in Windows boxes an

How to Burn CD/DVD in Linux Using Brasero How to Burn CD/DVD in Linux Using Brasero Jul 05, 2025 am 09:26 AM

Frankly speaking, I cannot recall the last time I used a PC with a CD/DVD drive. This is thanks to the ever-evolving tech industry which has seen optical disks replaced by USB drives and other smaller and compact storage media that offer more storage

How to find my private and public IP address in Linux? How to find my private and public IP address in Linux? Jul 09, 2025 am 12:37 AM

In Linux systems, 1. Use ipa or hostname-I command to view private IP; 2. Use curlifconfig.me or curlipinfo.io/ip to obtain public IP; 3. The desktop version can view private IP through system settings, and the browser can access specific websites to view public IP; 4. Common commands can be set as aliases for quick call. These methods are simple and practical, suitable for IP viewing needs in different scenarios.

How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8 How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8 Jul 13, 2025 am 09:09 AM

Built on Chrome’s V8 engine, Node.JS is an open-source, event-driven JavaScript runtime environment crafted for building scalable applications and backend APIs. NodeJS is known for being lightweight and efficient due to its non-blocking I/O model and

See all articles
天王表属于什么档次 组胺过敏是什么意思 什么奔什么走 尿道感染有什么症状 大便出血吃什么药好得快
女性分泌物带血是什么原因 睾丸疼痛什么原因 见人说人话见鬼说鬼话是什么意思 丘疹用什么药膏最有效 梦见抓蝎子是什么意思
看痔疮挂什么科 妇科检查清洁度3度什么意思 扁平足是什么样的 什么水果对皮肤好 生理曲度变直什么意思
pet是什么检查 什么是毛囊炎及症状图片 女人右眼跳是什么意思 脑白质变性是什么意思 什么叫npc
nf是什么单位hcv9jop5ns0r.cn moss是什么意思hcv8jop5ns9r.cn 甜字五行属什么hcv9jop0ns3r.cn 口苦尿黄是什么原因hcv7jop9ns8r.cn 什么是直肠炎hcv9jop1ns8r.cn
嗳气是什么原因引起的96micro.com 红糖不能和什么一起吃sscsqa.com 为什么不能送手表1949doufunao.com 治飞蚊症用什么眼药水wmyky.com 高密度脂蛋白胆固醇偏高什么意思hcv8jop1ns0r.cn
胸膜炎吃什么药1949doufunao.com 空气炸锅什么牌子好hcv9jop0ns9r.cn 刀代表什么数字zsyouku.com 淡墨是什么意思hcv9jop2ns8r.cn 白带异常是什么原因hcv9jop1ns0r.cn
心口疼是什么原因引起的hcv9jop0ns0r.cn 包茎不割会有什么影响hcv8jop9ns1r.cn 梦见老人死了又活了是什么意思zhongyiyatai.com 真菌最怕什么hcv7jop4ns5r.cn 鹅蛋不能和什么一起吃clwhiglsz.com
百度