DNS服务器安装与配置(Linux)

简介: 1、yum install -y bind bind-utils bind-chroot bind-libs;2、其中:/etc/named.conf 为主配置文件;/var/named 为解析文件3、客户端的dns查询时的配置文件/etc/hosts 默认优先查询这个/etc/resolv.

1、yum install -y bind bind-utils bind-chroot bind-libs;
2、其中:/etc/named.conf 为主配置文件;/var/named 为解析文件
3、客户端的dns查询时的配置文件
/etc/hosts 默认优先查询这个
/etc/resolv.conf DNS写在这里面
/etc/nsswitch.conf 查询优先级的设在这里
4、vi /etc/named.conf
options {
listen-on port 53 { any; };
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";
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;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";

    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";

};

zone "." IN {
type hint;
file "named.ca";
};

zone "weixin.qq.com" IN {
type master;
file "named.weixin.qq.com";
};
zone "49.61.183.in-addr.arpa" IN{
type master;
file "named.183.61.49";
};
zone "140.215.14.in-addr.arpa" IN{
type master;
file "named.14.215.140";
};
zone "alipay.com" IN {
type master;
file "named.alipay.com";
};
zone "75.110.in-addr.arpa" IN{
type master;
file "named.110.75";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

5、vi /var/named/named.aplipay.com
$TTL 600
@ IN SOA dns.xmrbi.com. dns.xmrbi.com. (2018011901 3H 15M 1W 1D )
@ IN NS dns.xmrbi.com. ; DNS 服务器名称
dns.xmrbi.com. IN A 172.16.50.30 ; DNS 服务器 IP

openapi.alipay.com. IN A 110.75.244.202
mapi.alipay.com. IN A 110.75.231.40

6、vi /var/namd/named.110.75

$TTL 600
@ IN SOA dns.xmrbi.com. dns.xmrbi.com. (2018011901 3H 15M 1W 1D )
@ IN NS dns.xmrbi.com. ; DNS 服务器名称
dns.xmrbi.com. IN A 172.16.50.30 ; DNS 服务器 IP

244.202 IN PTR openapi.alipay.com.
231.40 IN PTR mapi.alipay.com.

目录
相关文章
|
10月前
|
Ubuntu Linux 网络安全
Linux服务器之Ubuntu的安装与配置
Ubuntu Desktop是目前最成功、最流行的图形界面的Linux发行版;而Ubuntu Server也在服务器端市场占据了较大的份额。今天为大家详细介绍了Ubuntu Server的安装与配置,希望对你能有所帮助。关于VMware、VirtualBox等虚拟化软件的使用,朱哥还会在后续的文章中为大家详细介绍,敬请关注!
|
8月前
|
Shell Linux 网络安全
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
1386 3
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
|
8月前
|
存储 Linux 开发工具
Linux环境下使用Buildroot配置软件包
使用Buildroot可以大大简化嵌入式Linux系统的开发和维护工作,但它需要对Linux系统和交叉编译有深入的理解。通过上述步骤,可以有效地配置和定制软件包,为特定的嵌入式应用构建高效、稳定的系统。
927 11
|
9月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
470 18
|
9月前
|
Ubuntu 安全 关系型数据库
安装MariaDB服务器流程介绍在Ubuntu 22.04系统上
至此, 您已经在 Ubuntu 22.04 系统上成功地完成了 MariadB 的标准部署流程,并且对其进行基础但重要地初步配置加固工作。通过以上简洁明快且实用性强大地操作流程, 您现在拥有一个待定制与使用地强大 SQL 数据库管理系统。
630 15
|
9月前
|
弹性计算 安全 Linux
使用阿里云服务器安装Z-Blog博客网站流程,新手一键部署教程
本教程教你如何在阿里云99元服务器上,通过宝塔Linux面板一键部署Z-Blog博客。基于CentOS 7.9系统,从远程连接、安装宝塔面板、开放端口到部署Z-Blog全流程详解,操作简单,新手也能轻松搭建个人博客网站。
1092 13
|
10月前
|
弹性计算 安全 Linux
阿里云服务器ECS安装宝塔Linux面板、安装网站(新手图文教程)
本教程详解如何在阿里云服务器上安装宝塔Linux面板,涵盖ECS服务器手动安装步骤,包括系统准备、远程连接、安装命令执行、端口开放及LNMP环境部署,手把手引导用户快速搭建网站环境。
|
10月前
|
Ubuntu Linux
如何在 Ubuntu 服务器上安装桌面环境(GUI)
如果你有任何问题,请在评论区留言。你会在服务器上使用 GUI 吗?参照本文后你遇到了什么问题吗?
2232 0
|
11月前
|
Kubernetes Linux 网络安全
Rocky Linux 8.9配置Kubernetes集群详解,适用于CentOS环境
初始化成功后,记录下显示的 `kubeadm join`命令。
778 0
|
11月前
|
监控 Linux 网络安全
FinalShell SSH工具下载,服务器管理,远程桌面加速软件,支持Windows,macOS,Linux
FinalShell是一款国人开发的多平台SSH客户端工具,支持Windows、Mac OS X和Linux系统。它提供一体化服务器管理功能,支持shell和sftp同屏显示,命令自动提示,操作便捷。软件还具备加速功能,提升访问服务器速度,适合普通用户和专业人士使用。
3579 0

相关产品

  • 云解析DNS