当前位置:网站首页>DNS server configuration
DNS server configuration
2022-07-07 08:04:00 【redcell5】
linux build dns The server
Requirements are as follows : Configure the domain name :test.com—>192.168.114.2
Modify the following documents :
/etc/named.conf
/var/named/named.domain.zones
/var/named/named. Custom domain name .zone, Such as :/var/named/named.test.com.zone
First step : edit /var/named/named.test.com.zone, The contents are as follows
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ; minimum
)
NS @
A 192.168.114.2
www A 192.168.114.2
The second step : edit /var/named/named.domain.zones, The contents are as follows
zone "test.com" IN {
type master;
file "named.test.com.zone";
};
The third step : Set up dns port , Modify the following contents in the file :/etc/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.
//
options {
listen-on port 53 {
any; };
listen-on-v6 port 53 {
any; };
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";
secroots-file "/var/named/data/named.secroots";
recursing-file "/var/named/data/named.recursing";
allow-query {
any; };
/*
- 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 scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
include "/etc/crypto-policies/back-ends/bind.config";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/var/named/named.domain.zones";
Step four : restart dns service
systemctl restart named
Step five :linux Specify domain name server
[[email protected] ~]# cat /etc/resolv.conf
# Generated by NetworkManager
# nameserver 200.200.10.199
nameserver 192.168.114.2
Step six : test
[[email protected] ~]# nslookup test.com
Server: 192.168.114.2
Address: 192.168.114.2#53
Name: test.com
Address: 192.168.114.2
[[email protected] ~]# nslookup www.test.com
Server: 192.168.114.2
Address: 192.168.114.2#53
Name: www.test.com
Address: 192.168.114.2
[[email protected] ~]#
Reference material :https://www.cnblogs.com/reader/p/5616181.html
Learn knowledge
"sed -i 's/port\s+\d+\s*{/port hash[:port]{/g' /etc/named.conf"
"sed -i '/named.domain.zones/d' /etc/named.conf" # Delete include named.domain.zones Line of string
"echo 'include \"#{domain_zones_file}\";' >> /etc/named.conf"
"sed 's/::1;/any;/g' -i #{named_conf_file}" # Replace a string
边栏推荐
- 运放电路的反馈电阻上并联一个电容是什么作用
- The principle and implementation of buffer playback of large video files
- 2022年茶艺师(中级)考试试题及模拟考试
- Bugku CTF daily one question chessboard with only black chess
- Button wizard script learning - about tmall grabbing red envelopes
- 【數字IC驗證快速入門】15、SystemVerilog學習之基本語法2(操作符、類型轉換、循環、Task/Function...內含實踐練習)
- 快速使用 Jacoco 代码覆盖率统计
- 解决问题:Unable to connect to Redis
- Wechat applet data binding multiple data
- [quickstart to Digital IC Validation] 15. Basic syntax for SystemVerilog Learning 2 (operator, type conversion, loop, Task / Function... Including practical exercises)
猜你喜欢

【数字IC验证快速入门】10、Verilog RTL设计必会的FIFO

运放电路的反馈电阻上并联一个电容是什么作用

Custom class loader loads network class
![[2022 ciscn] replay of preliminary web topics](/img/1c/4297379fccde28f76ebe04d085c5a4.png)
[2022 ciscn] replay of preliminary web topics

Few shot Learning & meta learning: small sample learning principle and Siamese network structure (I)
![[UTCTF2020]file header](/img/e3/818e2d531a06ab90de189055f634ad.png)
[UTCTF2020]file header

Wechat applet data binding multiple data

探索Cassandra的去中心化分布式架构

2022茶艺师(初级)考试题模拟考试题库及在线模拟考试

Thinkcmf6.0 installation tutorial
随机推荐
[UVM practice] Chapter 2: a simple UVM verification platform (2) only driver verification platform
[unity] several ideas about circular motion of objects
Installing postgresql11 database under centos7
[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)
央视太暖心了,手把手教你写HR最喜欢的简历
力扣(LeetCode)187. 重复的DNA序列(2022.07.06)
The principle and implementation of buffer playback of large video files
【数字IC验证快速入门】14、SystemVerilog学习之基本语法1(数组、队列、结构体、枚举、字符串...内含实践练习)
Custom class loader loads network class
[Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替
Quickly use Jacobo code coverage statistics
[UVM practice] Chapter 1: configuring the UVM environment (taking VCs as an example), run through the examples in the book
[Stanford Jiwang cs144 project] lab3: tcpsender
Button wizard collection learning - mineral medicine collection and running map
The charm of SQL optimization! From 30248s to 0.001s
Zsh shell adds automatic completion and syntax highlighting
paddlepaddle 29 无模型定义代码下动态修改网络结构(relu变prelu,conv2d变conv3d,2d语义分割模型改为3d语义分割模型)
Force buckle 145 Binary Tree Postorder Traversal
JS quick start (I)
Open source ecosystem | create a vibrant open source community and jointly build a new open source ecosystem!