一、参考链接
阿里巴巴开源镜像站:阿里巴巴开源镜像站
DNS 装置教程:DNS 装置教程
二、DNS 简介
域名零碎(服务)协定(DNS)是一种分布式网络目录服务,次要用于域名与 IP 地址的互相转换,以及管制因特网的电子邮件的发送。
三、配置办法
Linux 疾速配置 ipv4
编辑文件 “/etc/resolv.conf”,依据状况批改文件内容。
只须要增加以下两行
nameserver 223.5.5.5
nameserver 223.6.6.6
[root@ecs-kunpeng ~]# vim /etc/resolv.conf
[root@ecs-kunpeng ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search openstacklocal
#nameserver 100.125.1.250
#nameserver 100.125.129.250
options timeout:1 single-request-reopen
nameserver 223.5.5.5
nameserver 223.6.6.6
[root@ecs-kunpeng ~]#
Linux 疾速配置 ipv6
编辑文件 “/etc/resolv.conf”,依据状况批改文件内容。
只须要增加以下两行
nameserver 2400:3200::1
nameserver 2400:3200:baba::1
[root@ecs-kunpeng ~]# vim /etc/resolv.conf
[root@ecs-kunpeng ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search openstacklocal
#nameserver 100.125.1.250
#nameserver 100.125.129.250
options timeout:1 single-request-reopen
nameserver 223.5.5.5
nameserver 223.6.6.6
nameserver 2400:3200::1
nameserver 2400:3200:baba::1
保留退出,而后应用 dig 验证:
若显示以下错误信息
[root@ecs-kunpeng ~]# dig alidns.com
-bash: dig: command not found
[root@ecs-kunpeng ~]#
[root@ecs-kunpeng ~]# yum provides dig
bind-utils-32:9.11.26-4.el8_4.aarch64 : Utilities for querying DNS name servers
Repo : AppStream
Matched from:
Filename : /usr/bin/dig
应用 yum 源装置 bind-utils-32:9.11.26-4.el8_4.aarch64
组件
[root@ecs-kunpeng ~]# yum install -y bind-utils-32:9.11.26-4.el8_4.aarch64
CentOS-8 - AppStream 44 kB/s | 4.3 kB 00:00
CentOS-8 - Base 40 kB/s | 3.9 kB 00:00
CentOS-8 - Extras 15 kB/s | 1.5 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - aarch64 28 kB/s | 3.0 kB 00:00
Extra Packages for Enterprise Linux 8 - aarch64 47 kB/s | 4.7 kB 00:00
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
bind-utils aarch64 32:9.11.26-4.el8_4 AppStream 445 k
Installing dependencies:
bind-libs aarch64 32:9.11.26-4.el8_4 AppStream 169 k
bind-libs-lite aarch64 32:9.11.26-4.el8_4 AppStream 1.1 M
bind-license noarch 32:9.11.26-4.el8_4 AppStream 102 k
fstrm aarch64 0.6.0-3.el8.1 AppStream 27 k
protobuf-c aarch64 1.3.0-6.el8 AppStream 37 k
python3-bind noarch 32:9.11.26-4.el8_4 AppStream 149 k
Transaction Summary
========================================================================================================================
Install 7 Packages
Total download size: 2.0 M
Installed size: 5.4 M
Downloading Packages:
(1/7): bind-license-9.11.26-4.el8_4.noarch.rpm 714 kB/s | 102 kB 00:00
(2/7): bind-libs-lite-9.11.26-4.el8_4.aarch64.rpm 6.7 MB/s | 1.1 MB 00:00
(3/7): fstrm-0.6.0-3.el8.1.aarch64.rpm 892 kB/s | 27 kB 00:00
(4/7): bind-utils-9.11.26-4.el8_4.aarch64.rpm 7.9 MB/s | 445 kB 00:00
(5/7): protobuf-c-1.3.0-6.el8.aarch64.rpm 1.2 MB/s | 37 kB 00:00
(6/7): python3-bind-9.11.26-4.el8_4.noarch.rpm 5.0 MB/s | 149 kB 00:00
(7/7): bind-libs-9.11.26-4.el8_4.aarch64.rpm 714 kB/s | 169 kB 00:00
------------------------------------------------------------------------------------------------------------------------
Total 8.3 MB/s | 2.0 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : protobuf-c-1.3.0-6.el8.aarch64 1/7
Installing : fstrm-0.6.0-3.el8.1.aarch64 2/7
Installing : bind-license-32:9.11.26-4.el8_4.noarch 3/7
Installing : bind-libs-lite-32:9.11.26-4.el8_4.aarch64 4/7
Installing : bind-libs-32:9.11.26-4.el8_4.aarch64 5/7
Installing : python3-bind-32:9.11.26-4.el8_4.noarch 6/7
Installing : bind-utils-32:9.11.26-4.el8_4.aarch64 7/7
Running scriptlet: bind-utils-32:9.11.26-4.el8_4.aarch64 7/7
Verifying : bind-libs-32:9.11.26-4.el8_4.aarch64 1/7
Verifying : bind-libs-lite-32:9.11.26-4.el8_4.aarch64 2/7
Verifying : bind-license-32:9.11.26-4.el8_4.noarch 3/7
Verifying : bind-utils-32:9.11.26-4.el8_4.aarch64 4/7
Verifying : fstrm-0.6.0-3.el8.1.aarch64 5/7
Verifying : protobuf-c-1.3.0-6.el8.aarch64 6/7
Verifying : python3-bind-32:9.11.26-4.el8_4.noarch 7/7
Installed:
bind-utils-32:9.11.26-4.el8_4.aarch64 bind-libs-32:9.11.26-4.el8_4.aarch64 bind-libs-lite-32:9.11.26-4.el8_4.aarch64
bind-license-32:9.11.26-4.el8_4.noarch fstrm-0.6.0-3.el8.1.aarch64 protobuf-c-1.3.0-6.el8.aarch64
python3-bind-32:9.11.26-4.el8_4.noarch
Complete!
[root@ecs-kunpeng ~]#
应用 dig 验证
若返回后果的 server 为阿里公共 DNS,则配置胜利。
[root@ecs-kunpeng ~]# dig alidns.com
; <<>> DiG 9.11.26-RedHat-9.11.26-4.el8_4 <<>> alidns.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57868
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;alidns.com. IN A
;; ANSWER SECTION:
alidns.com. 120 IN A 203.119.175.226
;; Query time: 12 msec
;; SERVER: 223.5.5.5#53(223.5.5.5)
;; WHEN: Fri Dec 03 23:29:35 CST 2021
;; MSG SIZE rcvd: 44
[root@ecs-kunpeng ~]#