29
2020
06
18:15:07

redhat7.3虚拟机搭建DNS

[root@localhost ~]# hostnamectl set-hostname 041zj


[root@localhost ~]# su


[root@041zj ~]# ifconfig


ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500


        ether 00:0c:29:a3:a4:f5  txqueuelen 1000  (Ethernet)


        RX packets 24  bytes 4176 (4.0 KiB)


        RX errors 0  dropped 0  overruns 0  frame 0


        TX packets 0  bytes 0 (0.0 B)


        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


 


ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500


        ether 00:0c:29:a3:a4:ff  txqueuelen 1000  (Ethernet)


        RX packets 24  bytes 4176 (4.0 KiB)


        RX errors 0  dropped 0  overruns 0  frame 0


        TX packets 0  bytes 0 (0.0 B)


        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


 


lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536


        inet 127.0.0.1  netmask 255.0.0.0


        inet6 ::1  prefixlen 128  scopeid 0x10<host>


        loop  txqueuelen 1  (Local Loopback)


        RX packets 326  bytes 27648 (27.0 KiB)


        RX errors 0  dropped 0  overruns 0  frame 0


        TX packets 326  bytes 27648 (27.0 KiB)


        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


 


virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500


        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255


        ether 52:54:00:18:1a:9e  txqueuelen 1000  (Ethernet)


        RX packets 0  bytes 0 (0.0 B)


        RX errors 0  dropped 0  overruns 0  frame 0


        TX packets 0  bytes 0 (0.0 B)


        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


 


[root@041zj ~]# nmcli connection add type ethernet ifname ens34 con-name eth1 ipv4.address 192.168.5.141/24 ipv4.gateway 192.168.5.1 ipv4.dns 192.168.5.1


成功添加的连接 'eth1'(e56e1702-7e98-4045-8285-0e3efc5c6e7e)。


[root@041zj ~]# nmcli connection up ens34


错误:unknown connection 'ens34'。


[root@041zj ~]# nmcli connection up eth1


成功激活的连接(D-Bus 激活路径:/org/freedesktop/NetworkManager/ActiveConnection/3)


[root@041zj ~]# nmcli device show ens34


GENERAL.设备:                           ens34


GENERAL.类型:                           ethernet


GENERAL.硬盘:                           00:0C:29:A3:A4:FF


GENERAL.MTU:                            1500


GENERAL.状态:                           100 (连接的)


GENERAL.CONNECTION:                     eth1


GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/3


WIRED-PROPERTIES.容器:                  开


IP4.地址[1]:                            192.168.5.141/24


IP4.地址[2]:                            192.168.43.161/24


IP4.网关:                               192.168.5.1


IP4.DNS[1]:                             192.168.43.1


IP4.DNS[2]:                             192.168.5.1


IP6.地址[1]:                            fe80::feb6:8cfe:c59b:6568/64


IP6.网关:                              


[root@041zj ~]# mount /dev/sr0 /mnt/


mount: /dev/sr0 写保护,将以只读方式挂载


[root@041zj ~]# ls /mnt/


addons  EULA  images    LiveOS      Packages       repodata                 RPM-GPG-KEY-redhat-release


EFI     GPL   isolinux  media.repo  release-notes  RPM-GPG-KEY-redhat-beta  TRANS.TBL


[root@041zj ~]# cp -rf /mnt/media.repo /etc/yum.repos.d/zj.repo


[root@041zj ~]# vim /etc/yum.repos.d/zj.repo


[root@041zj ~]# yum install -y xs vsftpd


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


InstallMedia                                                                                                                   | 4.1 kB  00:00:00    


(1/2): InstallMedia/primary_db                                                                                                 | 3.9 MB  00:00:00    


(2/2): InstallMedia/group_gz                                                                                                   | 136 kB  00:00:00    


没有可用软件包 xs。


正在解决依赖关系


--> 正在检查事务


---> 软件包 vsftpd.x86_64.0.3.0.2-21.el7 将被 安装


--> 解决依赖关系完成


 


依赖关系解决


 


======================================================================================================================================================


 Package                         架构                            版本                                     源                                     大小


======================================================================================================================================================


正在安装:


 vsftpd                          x86_64                          3.0.2-21.el7                             InstallMedia                          169 k


 


事务概要


======================================================================================================================================================


安装  1 软件包


 


总下载量:169 k


安装大小:348 k


Downloading packages:


警告:/mnt/Packages/vsftpd-3.0.2-21.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID fd431d51: NOKEY


vsftpd-3.0.2-21.el7.x86_64.rpm 的公钥尚未安装


从 file:///mnt/RPM-GPG-KEY-redhat-release 检索密钥


导入 GPG key 0xFD431D51:


 用户ID     : "Red Hat, Inc. (release key 2) <security@redhat.com>"


 指纹       : 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51


 来自       : /mnt/RPM-GPG-KEY-redhat-release


导入 GPG key 0x2FA658E0:


 用户ID     : "Red Hat, Inc. (auxiliary key) <security@redhat.com>"


 指纹       : 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0


 来自       : /mnt/RPM-GPG-KEY-redhat-release


Running transaction check


Running transaction test


Transaction test succeeded


Running transaction


  正在安装    : vsftpd-3.0.2-21.el7.x86_64                                                                                                        1/1


InstallMedia/productid                                                                                                         | 1.6 kB  00:00:00    


  验证中      : vsftpd-3.0.2-21.el7.x86_64                                                                                                        1/1


 


已安装:


  vsftpd.x86_64 0:3.0.2-21.el7                                                                                                                       


 


完毕!


[root@041zj ~]# yum search -y xs


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


================================================================== N/S matched: xs ===================================================================


docbook-style-xsl.noarch : Norman Walsh's XSL stylesheets for DocBook XML


docbook5-style-xsl.noarch : Norman Walsh's XSL stylesheets for DocBook 5.X


libXScrnSaver.i686 : X.Org X11 libXss runtime library


libXScrnSaver.x86_64 : X.Org X11 libXss runtime library


libXScrnSaver-devel.i686 : X.Org X11 libXScrnSaver development package


libXScrnSaver-devel.x86_64 : X.Org X11 libXScrnSaver development package


libxshmfence-devel.i686 : Development files for libxshmfence


libxshmfence-devel.x86_64 : Development files for libxshmfence


libxslt.i686 : Library providing the Gnome XSLT engine


libxslt.x86_64 : Library providing the Gnome XSLT engine


libxslt-devel.i686 : Development files for libxslt


libxslt-devel.x86_64 : Development files for libxslt


perl-ExtUtils-ParseXS.noarch : Module and a script for converting Perl XS code into C code


xsane-common.x86_64 : Common files for xsane packages


xsettings-kde.x86_64 : XSettings Daemon for KDE


xsom.noarch : XML Schema Object Model (XSOM)


yelp-xsl.noarch : XSL stylesheets for the yelp help browser


gnome-session-xsession.x86_64 : Desktop file for gnome-session


libxshmfence.i686 : X11 shared memory fences


libxshmfence.x86_64 : X11 shared memory fences


msv-xsdlib.noarch : Multi-Schema Validator XML Schema Library


passivetex.noarch : Macros to process XSL formatting objects


perl-JSON-PP.noarch : JSON::XS compatible pure-Perl module


perl-Package-Stash-XS.x86_64 : Faster and more correct implementation of the Package::Stash API


python-lxml.x86_64 : ElementTree-like Python bindings for libxml2 and libxslt


xalan-j2.noarch : Java XSLT processor


xcb-util-image.i686 : Port of Xlib's XImage and XShmImage functions on top of libxcb


xcb-util-image.x86_64 : Port of Xlib's XImage and XShmImage functions on top of libxcb


xsane-gimp.x86_64 : GIMP plug-in providing the SANE scanner interface


 


  名称和简介匹配 only,使用“search all”试试。


[root@041zj ~]# yum search -y vsftpd


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


================================================================ N/S matched: vsftpd =================================================================


vsftpd.x86_64 : Very Secure Ftp Daemon


 


  名称和简介匹配 only,使用“search all”试试。


[root@041zj ~]# yum install -y bind bind-chroot bind-utils


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


软件包 32:bind-utils-9.9.4-37.el7.x86_64 已安装并且是最新版本


正在解决依赖关系


--> 正在检查事务


---> 软件包 bind.x86_64.32.9.9.4-37.el7 将被 安装


---> 软件包 bind-chroot.x86_64.32.9.9.4-37.el7 将被 安装


--> 解决依赖关系完成


 


依赖关系解决


 


======================================================================================================================================================


 Package                            架构                          版本                                      源                                   大小


======================================================================================================================================================


正在安装:


 bind                               x86_64                        32:9.9.4-37.el7                           InstallMedia                        1.8 M


 bind-chroot                        x86_64                        32:9.9.4-37.el7                           InstallMedia                         84 k


 


事务概要


======================================================================================================================================================


安装  2 软件包


 


总下载量:1.9 M


安装大小:4.3 M


Downloading packages:


------------------------------------------------------------------------------------------------------------------------------------------------------


总计                                                                                                                   76 MB/s | 1.9 MB  00:00:00    


Running transaction check


Running transaction test


Transaction test succeeded


Running transaction


  正在安装    : 32:bind-9.9.4-37.el7.x86_64                                                                                                       1/2


  正在安装    : 32:bind-chroot-9.9.4-37.el7.x86_64                                                                                                2/2


  验证中      : 32:bind-chroot-9.9.4-37.el7.x86_64                                                                                                1/2


  验证中      : 32:bind-9.9.4-37.el7.x86_64                                                                                                       2/2


 


已安装:


  bind.x86_64 32:9.9.4-37.el7                                            bind-chroot.x86_64 32:9.9.4-37.el7                                          


 


完毕!


[root@041zj ~]# yum search -y bind-utils


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


============================================================== N/S matched: bind-utils ===============================================================


bind-utils.x86_64 : Utilities for querying DNS name servers


 


  名称和简介匹配 only,使用“search all”试试。


[root@041zj ~]# yum search -y bind-chroot


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


============================================================== N/S matched: bind-chroot ==============================================================


bind-chroot.x86_64 : A chroot runtime environment for the ISC BIND DNS server, named(8)


 


  名称和简介匹配 only,使用“search all”试试。


[root@041zj ~]# yum search -y bind


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


================================================================= N/S matched: bind ==================================================================


bind.x86_64 : The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server


bind-chroot.x86_64 : A chroot runtime environment for the ISC BIND DNS server, named(8)


bind-dyndb-ldap.x86_64 : LDAP back-end plug-in for BIND


bind-libs.i686 : Libraries used by the BIND DNS packages


bind-libs.x86_64 : Libraries used by the BIND DNS packages


bind-license.noarch : License of the BIND DNS suite


bind-pkcs11.x86_64 : Bind with native PKCS#11 functionality for crypto


bind-pkcs11-libs.i686 : Bind libraries compiled with native PKCS#11


bind-pkcs11-libs.x86_64 : Bind libraries compiled with native PKCS#11


bind-pkcs11-utils.x86_64 : Bind tools with native PKCS#11 for using DNSSEC


samba-winbind.x86_64 : Samba winbind


samba-winbind-clients.x86_64 : Samba winbind clients


samba-winbind-modules.i686 : Samba winbind modules


samba-winbind-modules.x86_64 : Samba winbind modules


ypbind.x86_64 : The NIS daemon which binds NIS clients to an NIS domain


ImageMagick-c++.i686 : ImageMagick Magick++ library (C++ bindings)


ImageMagick-c++.x86_64 : ImageMagick Magick++ library (C++ bindings)


ImageMagick-perl.x86_64 : ImageMagick perl bindings


PyPAM.x86_64 : PAM bindings for Python


PyQt4.i686 : Python bindings for Qt4


PyQt4.x86_64 : Python bindings for Qt4


PyQt4-devel.i686 : Files needed to build other bindings based on Qt4


PyQt4-devel.x86_64 : Files needed to build other bindings based on Qt4


audit-libs-python.x86_64 : Python bindings for libaudit


bind-libs-lite.i686 : Libraries for working with the DNS protocol


bind-libs-lite.x86_64 : Libraries for working with the DNS protocol


bind-utils.x86_64 : Utilities for querying DNS name servers


cairo-gobject.i686 : GObject bindings for cairo


cairo-gobject.x86_64 : GObject bindings for cairo


cmpi-bindings-pywbem.x86_64 : Adapter to write and run CMPI-type CIM providers in Python


compat-libxcb.i686 : A C binding to the X11 protocol


compat-libxcb.x86_64 : A C binding to the X11 protocol


cryptsetup-python.x86_64 : Python bindings for libcryptsetup


dbus-glib.i686 : GLib bindings for D-Bus


dbus-glib.x86_64 : GLib bindings for D-Bus


dbus-glib-devel.i686 : Libraries and headers for the D-Bus GLib bindings


dbus-glib-devel.x86_64 : Libraries and headers for the D-Bus GLib bindings


dbus-python.x86_64 : D-Bus Python Bindings


emacs-gnuplot.noarch : Emacs bindings for the gnuplot main application


gjs.i686 : Javascript Bindings for GNOME


gjs.x86_64 : Javascript Bindings for GNOME


glassfish-jaxb-api.noarch : Java Architecture for XML Binding


gnome-python2-bonobo.x86_64 : Python bindings for interacting with Bonobo


gnome-python2-canvas.x86_64 : Python bindings for the GNOME Canvas


gnome-python2-gconf.x86_64 : Python bindings for interacting with GConf


gnome-python2-gnome.x86_64 : Python bindings for libgnome


gnome-python2-gnomevfs.x86_64 : Python bindings for interacting with gnome-vfs


keybinder3.i686 : A library for registering global keyboard shortcuts


keybinder3.x86_64 : A library for registering global keyboard shortcuts


konkretcmpi-python.x86_64 : Python bindings for konkretcmpi


lasso-python.x86_64 : Liberty Alliance Single Sign On (lasso) Python bindings


libcanberra-gtk2.i686 : Gtk+ 2.x Bindings for libcanberra


libcanberra-gtk2.x86_64 : Gtk+ 2.x Bindings for libcanberra


libcanberra-gtk3.i686 : Gtk+ 3.x Bindings for libcanberra


libcanberra-gtk3.x86_64 : Gtk+ 3.x Bindings for libcanberra


libguestfs-java.x86_64 : Java bindings for libguestfs


liblouis-python.noarch : Python 2 language bindings for liblouis


libreport-python.x86_64 : Python bindings for report-libs


libselinux-python.x86_64 : SELinux python bindings for libselinux


libselinux-ruby.x86_64 : SELinux ruby bindings for libselinux


libsemanage-python.x86_64 : semanage python bindings for libsemanage


libuser-python.x86_64 : Python bindings for the libuser library


libvirt-java.noarch : Java bindings for the libvirt virtualization API


libvirt-python.x86_64 : The libvirt virtualization API python2 binding


libwbclient.i686 : The winbind client library


libwbclient.x86_64 : The winbind client library


libxcb.i686 : A C binding to the X11 protocol


libxcb.x86_64 : A C binding to the X11 protocol


libxml2-python.x86_64 : Python bindings for the libxml2 library


newt-python.x86_64 : Python bindings for newt


openscap-python.x86_64 : Python bindings for openscap


perl-FCGI.x86_64 : FastCGI Perl bindings


perl-Net-LibIDN.x86_64 : Perl bindings for GNU LibIDN


perl-Newt.x86_64 : Perl bindings for the Newt library


perl-PCP-PMDA.x86_64 : Performance Co-Pilot (PCP) Perl bindings and documentation


perl-Sys-Guestfs.x86_64 : Perl bindings for libguestfs (Sys::Guestfs)


perl-hivex.x86_64 : Perl bindings for hivex


polkit-qt.i686 : Qt bindings for PolicyKit


polkit-qt.x86_64 : Qt bindings for PolicyKit


protobuf-c.i686 : C bindings for Google's Protocol Buffers


protobuf-c.x86_64 : C bindings for Google's Protocol Buffers


pulseaudio-libs-glib2.i686 : GLIB 2.x bindings for PulseAudio clients


pulseaudio-libs-glib2.x86_64 : GLIB 2.x bindings for PulseAudio clients


pyatspi.noarch : Python bindings for at-spi


pycairo.x86_64 : Python bindings for the cairo library


pygobject2.i686 : Python 2 bindings for GObject


pygobject2.x86_64 : Python 2 bindings for GObject


pygobject3.x86_64 : Python 2 bindings for GObject Introspection


pygobject3-base.i686 : Python 2 bindings for GObject Introspection base package


pygobject3-base.x86_64 : Python 2 bindings for GObject Introspection base package


pygtk2.x86_64 : Python bindings for GTK+


pykde4.x86_64 : Python bindings for KDE4


pyldb.i686 : Python bindings for the LDB library


pyldb.x86_64 : Python bindings for the LDB library


pyliblzma.x86_64 : Python bindings for lzma


pyorbit.x86_64 : Python bindings for ORBit2


python-augeas.noarch : Python bindings to augeas


python-brlapi.x86_64 : Python binding for BrlAPI


python-cups.x86_64 : Python bindings for CUPS


python-deltarpm.x86_64 : Python bindings for deltarpm


python-ethtool.x86_64 : Ethernet settings python bindings


python-firewall.noarch : Python2 bindings for firewalld


python-gssapi.x86_64 : Python Bindings for GSSAPI (RFC 2743/2744 and extensions)


python-gudev.x86_64 : Python (PyGObject) bindings to the GUDev library


python-hwdata.noarch : Python bindings to hwdata package


python-libguestfs.x86_64 : Python bindings for libguestfs


python-libipa_hbac.x86_64 : Python2 bindings for the FreeIPA HBAC Evaluator library


python-libsss_nss_idmap.x86_64 : Python2 bindings for libsss_nss_idmap


python-lxml.x86_64 : ElementTree-like Python bindings for libxml2 and libxslt


python-magic.noarch : Python bindings for the libmagic API


python-nss.x86_64 : Python bindings for Network Security Services (NSS)


python-pcp.x86_64 : Performance Co-Pilot (PCP) Python bindings and documentation


python-perf.x86_64 : Python bindings for apps which will manipulate perf events


python-pwquality.x86_64 : Python bindings for the libpwquality library


python-pyudev.noarch : A libudev binding


python-schedutils.x86_64 : Linux scheduler python bindings


python-smbc.x86_64 : Python bindings for libsmbclient API from Samba


python-sss.x86_64 : Python2 bindings for sssd


python-sss-murmur.x86_64 : Python2 bindings for murmur hash function


python-tdb.i686 : Python bindings for the Tdb library


python-tdb.x86_64 : Python bindings for the Tdb library


python-tevent.x86_64 : Python bindings for the Tevent library


python-volume_key.x86_64 : Python bindings for libvolume_key


pyusb.noarch : Python bindings for libusb


qt5-qt3d.i686 : Qt5 - Qt3D QML bindings and C++ APIs


qt5-qt3d.x86_64 : Qt5 - Qt3D QML bindings and C++ APIs


rpcbind.x86_64 : Universal Addresses to RPC Program Number Mapper


rpm-python.x86_64 : Python bindings for apps which will manipulate RPM packages


sip.i686 : SIP - Python/C++ Bindings Generator


sip.x86_64 : SIP - Python/C++ Bindings Generator


sip-devel.i686 : Files needed to generate Python bindings for any C++ class library


sip-devel.x86_64 : Files needed to generate Python bindings for any C++ class library


systemd-python.x86_64 : Python 2 bindings for systemd


telepathy-glib.i686 : GLib bindings for Telepathy


telepathy-glib.x86_64 : GLib bindings for Telepathy


 


  名称和简介匹配 only,使用“search all”试试。


[root@041zj ~]# cp -ra /usr/share/doc/bind-9.9.4/sample/* /root/


[root@041zj ~]# cp -ra /usr/share/doc/bind-9.9.4/sample/* /var/named/chroot/


[root@041zj ~]# cd /var/named/chroot/


[root@041zj chroot]# ls -l


总用量 0


drwxr-x---. 2 root  named 44 6月  28 01:35 dev


drwxr-xr-x. 4 root  root  75 6月  28 01:35 etc


drwxr-x---. 3 root  named 19 6月  28 01:35 run


drwxrwx---. 3 named named 19 6月  28 01:35 usr


drwxr-xr-x. 5 root  root  52 6月  28 01:35 var


[root@041zj chroot]# chown -R root:named *


[root@041zj chroot]# ls -l


总用量 0


drwxr-x---. 2 root named 44 6月  28 01:35 dev


drwxr-xr-x. 4 root named 75 6月  28 01:35 etc


drwxr-x---. 3 root named 19 6月  28 01:35 run


drwxrwx---. 3 root named 19 6月  28 01:35 usr


drwxr-xr-x. 5 root named 52 6月  28 01:35 var


[root@041zj chroot]# pwd


/var/named/chroot


[root@041zj chroot]# cd var/named/


[root@041zj named]# ls


data  my.external.zone.db  my.internal.zone.db  named.ca  named.empty  named.localhost  named.loopback  slaves


[root@041zj named]# mkdir dynamic


[root@041zj named]# ls -l


总用量 24


drwxr-xr-x. 2 root named    6 9月  26 2016 data


drwxr-xr-x. 2 root root     6 6月  28 01:39 dynamic


-rw-r--r--. 1 root named   56 9月  26 2016 my.external.zone.db


-rw-r--r--. 1 root named   56 9月  26 2016 my.internal.zone.db


-rw-r--r--. 1 root named 2076 9月  26 2016 named.ca


-rw-r--r--. 1 root named  152 9月  26 2016 named.empty


-rw-r--r--. 1 root named  152 9月  26 2016 named.localhost


-rw-r--r--. 1 root named  168 9月  26 2016 named.loopback


drwxr-xr-x. 2 root named   71 6月  28 01:35 slaves


[root@041zj named]# chown -R  root:named dynamic/


[root@041zj named]# chmod 777 -R data dynamic/


[root@041zj named]# cd data/


[root@041zj data]# pwd


/var/named/chroot/var/named/data


[root@041zj data]# ls


[root@041zj data]# touch cache_dump.db


[root@041zj data]# touch named_stats.txt


[root@041zj data]# touch named_mem_stats.txt


[root@041zj data]# touch named.run


[root@041zj data]# cd ../dynamic/


[root@041zj dynamic]# touch managed_keys.bind


[root@041zj dynamic]# ls


managed_keys.bind


[root@041zj dynamic]# cd ../


[root@041zj named]# cd ..


[root@041zj var]# cd ..


[root@041zj chroot]# pwd


/var/named/chroot


[root@041zj chroot]# cd etc/


[root@041zj etc]# ls


named  named.conf  named.rfc1912.zones  pki


[root@041zj etc]# cp -rf named.conf named.conf.bak


[root@041zj etc]# vim named.conf


[root@041zj etc]# cd ..


[root@041zj chroot]# cd var/named/


[root@041zj named]# pwd


/var/named/chroot/var/named


[root@041zj named]# ls


data  dynamic  my.external.zone.db  my.internal.zone.db  named.ca  named.empty  named.localhost  named.loopback  slaves


[root@041zj named]# cp -ra named.localhost www.zj.com


[root@041zj named]# vim www.zj.com


[root@041zj named]# vim www.zj.com


[root@041zj named]# pwd


/var/named/chroot/var/named


[root@041zj named]# cp -ra www.zj.com 192.168.5.arpa


[root@041zj named]# vim 192.168.5.arpa


[root@041zj named]# systemctl stop firewalld


[root@041zj named]# systemctl disable firewalld


Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.


Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.


[root@041zj named]# systemctl disable named


[root@041zj named]# setenforce 0


[root@041zj named]# vim /etc/se


securetty       security/       selinux/        services        sestatus.conf   setroubleshoot/ setuptool.d/   


[root@041zj named]# vim /etc/selinux/config


[root@041zj named]# systemctl enable named-chroot


Created symlink from /etc/systemd/system/multi-user.target.wants/named-chroot.service to /usr/lib/systemd/system/named-chroot.service.


[root@041zj named]# getsebool -a|grep named


named_tcp_bind_http_port --> off


named_write_master_zones --> off


[root@041zj named]# setsebool named_tcp_bind_http_port on


[root@041zj named]# setsebool named_write_master_zones on


[root@041zj named]# getsebool -a|grep named


named_tcp_bind_http_port --> on


named_write_master_zones --> on


[root@041zj named]# systemctl start named-chroot


Job for named-chroot.service failed because the control process exited with error code. See "systemctl status named-chroot.service" and "journalctl -xe" for details.


[root@041zj named]# vim /etc/resolv.conf


[root@041zj named]# vim /etc/resolv.conf


[root@041zj named]# systemctl status named-chroot


● named-chroot.service - Berkeley Internet Name Domain (DNS)


   Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)


   Active: failed (Result: exit-code) since 四 2018-06-28 02:12:10 CST; 1min 33s ago


  Process: 4707 ExecStart=/usr/sbin/named -u named -t /var/named/chroot $OPTIONS (code=exited, status=1/FAILURE)


  Process: 4704 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)


 


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 76.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 77.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 78.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 79.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 80.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 81.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj systemd[1]: named-chroot.service: control process exited, code=exited status=1


6月 28 02:12:10 041zj systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).


6月 28 02:12:10 041zj systemd[1]: Unit named-chroot.service entered failed state.


6月 28 02:12:10 041zj systemd[1]: named-chroot.service failed.


[root@041zj named]# /usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf


zone zj.com/IN: loaded serial 20180627


zone 5.168.192.in-addr.arpa/IN: loaded serial 20180627


[root@041zj named]# journalctl -xe


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 124.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 125.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 126.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 127.100.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 0.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 127.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 254.169.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 2.0.192.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 100.51.198.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 113.0.203.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: D.F.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 8.E.F.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 9.E.F.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: A.E.F.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: B.E.F.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA


6月 28 02:12:10 041zj named[4709]: command channel listening on 127.0.0.1#953


6月 28 02:12:10 041zj named[4709]: command channel listening on ::1#953


6月 28 02:12:10 041zj named[4709]: isc_stdio_open 'data/named.run' failed: permission denied


6月 28 02:12:10 041zj named[4709]: configuring logging: permission denied


6月 28 02:12:10 041zj named[4709]: loading configuration: permission denied


6月 28 02:12:10 041zj named[4709]: exiting (due to fatal error)


6月 28 02:12:10 041zj polkitd[760]: Unregistered Authentication Agent for unix-process:4665:420474 (system bus name :1.156, object path /org/freedeskt


6月 28 02:12:10 041zj systemd[1]: Stopped Set-up/destroy chroot environment for named (DNS).


-- Subject: Unit named-chroot-setup.service has finished shutting down


-- Defined-By: systemd


-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel


--


-- Unit named-chroot-setup.service has finished shutting down.


[root@041zj named]# chmod 777 -R /var/named/chroot/var/named/data/


[root@041zj named]# systemctl start named-chroot


[root@041zj named]# ls -l


总用量 32


-rw-r--r--. 1 root named  335 6月  28 02:07 192.168.5.arpa


drwxrwxrwx. 2 root named   94 6月  28 01:41 data


drwxrwxrwx. 2 root named   31 6月  28 01:42 dynamic


-rw-r--r--. 1 root named   56 9月  26 2016 my.external.zone.db


-rw-r--r--. 1 root named   56 9月  26 2016 my.internal.zone.db


-rw-r--r--. 1 root named 2076 9月  26 2016 named.ca


-rw-r--r--. 1 root named  152 9月  26 2016 named.empty


-rw-r--r--. 1 root named  152 9月  26 2016 named.localhost


-rw-r--r--. 1 root named  168 9月  26 2016 named.loopback


drwxr-xr-x. 2 root named   71 6月  28 01:35 slaves


-rw-r--r--. 1 root named  382 6月  28 02:03 www.zj.com


[root@041zj named]# cd data/


[root@041zj data]# pwd


/var/named/chroot/var/named/data


[root@041zj data]# ls


cache_dump.db  named_mem_stats.txt  named.run  named_stats.txt


[root@041zj data]# restorecon -v 'named.run'


restorecon reset /var/named/chroot/var/named/data/named.run context unconfined_u:object_r:usr_t:s0->unconfined_u:object_r:named_cache_t:s0


[root@041zj data]# systemctl stop named-chroot


[root@041zj data]# systemctl start named-chroot


[root@041zj data]# systemctl status named-chroot


● named-chroot.service - Berkeley Internet Name Domain (DNS)


   Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)


   Active: active (running) since 四 2018-06-28 02:20:26 CST; 7s ago


  Process: 5183 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)


  Process: 5270 ExecStart=/usr/sbin/named -u named -t /var/named/chroot $OPTIONS (code=exited, status=0/SUCCESS)


  Process: 5267 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)


 Main PID: 5272 (named)


   CGroup: /system.slice/named-chroot.service


           └─5272 /usr/sbin/named -u named -t /var/named/chroot


 


6月 28 02:20:26 041zj named[5272]: automatic empty zone: B.E.F.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: command channel listening on 127.0.0.1#953


6月 28 02:20:26 041zj named[5272]: command channel listening on ::1#953


6月 28 02:20:26 041zj named[5272]: managed-keys-zone: loaded serial 0


6月 28 02:20:26 041zj named[5272]: zone 5.168.192.in-addr.arpa/IN: loaded serial 20180627


6月 28 02:20:26 041zj named[5272]: zone zj.com/IN: loaded serial 20180627


6月 28 02:20:26 041zj named[5272]: all zones loaded


6月 28 02:20:26 041zj named[5272]: running


6月 28 02:20:26 041zj named[5272]: zone 5.168.192.in-addr.arpa/IN: sending notifies (serial 20180627)


[root@041zj data]# journalctl -xe


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 120.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 121.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 122.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 123.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 124.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 125.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 126.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 127.100.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 0.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 127.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 254.169.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 2.0.192.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 100.51.198.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 113.0.203.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: D.F.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 8.E.F.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 9.E.F.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: A.E.F.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: B.E.F.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA


6月 28 02:20:26 041zj named[5272]: command channel listening on 127.0.0.1#953


6月 28 02:20:26 041zj named[5272]: command channel listening on ::1#953


6月 28 02:20:26 041zj named[5272]: managed-keys-zone: loaded serial 0


6月 28 02:20:26 041zj named[5272]: zone 5.168.192.in-addr.arpa/IN: loaded serial 20180627


6月 28 02:20:26 041zj named[5272]: zone zj.com/IN: loaded serial 20180627


6月 28 02:20:26 041zj named[5272]: all zones loaded


6月 28 02:20:26 041zj named[5272]: running


6月 28 02:20:26 041zj named[5272]: zone 5.168.192.in-addr.arpa/IN: sending notifies (serial 20180627)


6月 28 02:20:26 041zj polkitd[760]: Unregistered Authentication Agent for unix-process:5232:470134 (system bus name :1.166, object path /org/freedeskt


[root@041zj data]#


[root@041zj data]# nslookup www.zj.com


Server:           192.168.5.141


Address: 192.168.5.141#53


 


Name:    www.zj.com


Address: 192.168.5.141


 


[root@041zj data]# nslookup 192.168.5.141


Server:           192.168.5.141


Address: 192.168.5.141#53


 


** server can't find 141.5.168.192.in-addr.arpa.: NXDOMAIN


 


[root@041zj data]# vim /etc/resolv.conf


[root@041zj data]# nslookup 192.168.5.100


Server:           192.168.5.141


Address: 192.168.5.141#53


 


100.5.168.192.in-addr.arpa   name = ns1.zj.com.


100.5.168.192.in-addr.arpa   name = movie.zj.com.


100.5.168.192.in-addr.arpa   name = www.zj.com.


100.5.168.192.in-addr.arpa   name = ftp.zj.com.


100.5.168.192.in-addr.arpa   name = file.zj.com.


 


[root@041zj data]# yum install -y http


httpcomponents-client.noarch  httpd-devel.x86_64            httpd-tools.x86_64           


httpcomponents-core.noarch    httpd-manual.noarch           httpd.x86_64                 


[root@041zj data]# yum install -y httpd php mariadb


已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


正在解决依赖关系


--> 正在检查事务


---> 软件包 httpd.x86_64.0.2.4.6-45.el7 将被 安装


--> 正在处理依赖关系 httpd-tools = 2.4.6-45.el7,它被软件包 httpd-2.4.6-45.el7.x86_64 需要


--> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-45.el7.x86_64 需要


--> 正在处理依赖关系 libapr-1.so.0()(64bit),它被软件包 httpd-2.4.6-45.el7.x86_64 需要


--> 正在处理依赖关系 libaprutil-1.so.0()(64bit),它被软件包 httpd-2.4.6-45.el7.x86_64 需要


---> 软件包 mariadb.x86_64.1.5.5.52-1.el7 将被 安装


---> 软件包 php.x86_64.0.5.4.16-42.el7 将被 安装


--> 正在处理依赖关系 php-common(x86-64) = 5.4.16-42.el7,它被软件包 php-5.4.16-42.el7.x86_64 需要


--> 正在处理依赖关系 php-cli(x86-64) = 5.4.16-42.el7,它被软件包 php-5.4.16-42.el7.x86_64 需要


--> 正在检查事务


---> 软件包 apr.x86_64.0.1.4.8-3.el7 将被 安装


---> 软件包 apr-util.x86_64.0.1.5.2-6.el7 将被 安装


---> 软件包 httpd-tools.x86_64.0.2.4.6-45.el7 将被 安装


---> 软件包 mailcap.noarch.0.2.1.41-2.el7 将被 安装


---> 软件包 php-cli.x86_64.0.5.4.16-42.el7 将被 安装


---> 软件包 php-common.x86_64.0.5.4.16-42.el7 将被 安装


--> 正在处理依赖关系 libzip.so.2()(64bit),它被软件包 php-common-5.4.16-42.el7.x86_64 需要


--> 正在检查事务


---> 软件包 libzip.x86_64.0.0.10.1-8.el7 将被 安装


--> 解决依赖关系完成


 


依赖关系解决


 


======================================================================================================================================================


 Package                             架构                           版本                                   源                                    大小


======================================================================================================================================================


正在安装:


 httpd                               x86_64                         2.4.6-45.el7                           InstallMedia                         1.2 M


 mariadb                             x86_64                         1:5.5.52-1.el7                         InstallMedia                         8.6 M


 php                                 x86_64                         5.4.16-42.el7                          InstallMedia                         1.4 M


为依赖而安装:


 apr                                 x86_64                         1.4.8-3.el7                            InstallMedia                         103 k


 apr-util                            x86_64                         1.5.2-6.el7                            InstallMedia                          92 k


 httpd-tools                         x86_64                         2.4.6-45.el7                           InstallMedia                          84 k


 libzip                              x86_64                         0.10.1-8.el7                           InstallMedia                          49 k


 mailcap                             noarch                         2.1.41-2.el7                           InstallMedia                          31 k


 php-cli                             x86_64                         5.4.16-42.el7                          InstallMedia                         2.7 M


 php-common                          x86_64                         5.4.16-42.el7                          InstallMedia                         564 k


 


事务概要


======================================================================================================================================================


安装  3 软件包 (+7 依赖软件包)


 


总下载量:15 M


安装大小:70 M


Downloading packages:


------------------------------------------------------------------------------------------------------------------------------------------------------


总计                                                                                                                   68 MB/s |  15 MB  00:00:00    


Running transaction check


Running transaction test


Transaction test succeeded


Running transaction


  正在安装    : apr-1.4.8-3.el7.x86_64                                                                                                           1/10


  正在安装    : apr-util-1.5.2-6.el7.x86_64                                                                                                      2/10


  正在安装    : httpd-tools-2.4.6-45.el7.x86_64                                                                                                  3/10


  正在安装    : libzip-0.10.1-8.el7.x86_64                                                                                                       4/10


  正在安装    : php-common-5.4.16-42.el7.x86_64                                                                                                  5/10


  正在安装    : php-cli-5.4.16-42.el7.x86_64                                                                                                     6/10


  正在安装    : mailcap-2.1.41-2.el7.noarch                                                                                                      7/10


  正在安装    : httpd-2.4.6-45.el7.x86_64                                                                                                        8/10


  正在安装    : php-5.4.16-42.el7.x86_64                                                                                                         9/10


  正在安装    : 1:mariadb-5.5.52-1.el7.x86_64                                                                                                   10/10


  验证中      : 1:mariadb-5.5.52-1.el7.x86_64                                                                                                    1/10


  验证中      : apr-1.4.8-3.el7.x86_64                                                                                                           2/10


  验证中      : mailcap-2.1.41-2.el7.noarch                                                                                                      3/10


  验证中      : php-cli-5.4.16-42.el7.x86_64                                                                                                     4/10


  验证中      : httpd-tools-2.4.6-45.el7.x86_64                                                                                                  5/10


  验证中      : apr-util-1.5.2-6.el7.x86_64                                                                                                      6/10


  验证中      : php-5.4.16-42.el7.x86_64  


 


验证中      : libzip-0.10.1-8.el7.x86_64                                                                                                       8/10


  验证中      : httpd-2.4.6-45.el7.x86_64                                                                                                        9/10


  验证中      : php-common-5.4.16-42.el7.x86_64                                                                                                 10/10


 


已安装:


  httpd.x86_64 0:2.4.6-45.el7                      mariadb.x86_64 1:5.5.52-1.el7                      php.x86_64 0:5.4.16-42.el7                    


 


作为依赖被安装:


  apr.x86_64 0:1.4.8-3.el7            apr-util.x86_64 0:1.5.2-6.el7        httpd-tools.x86_64 0:2.4.6-45.el7       libzip.x86_64 0:0.10.1-8.el7     


  mailcap.noarch 0:2.1.41-2.el7       php-cli.x86_64 0:5.4.16-42.el7       php-common.x86_64 0:5.4.16-42.el7     


 


完毕!


[root@041zj data]# systemctl start httpd


[root@041zj data]#




推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

本文链接:https://hqyman.cn/post/1406.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:
打赏





休息一下~~


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

请先 登录 再评论,若不是会员请先 注册

您的IP地址是: