CPU:i3-2100
核心數:2
執行緒:4
頻率:3.1GHz
RAM:4G
hostOS:win7 64bit
IP:192.168.1.101
getway:192.168.1.1
DNS:192.168.1.1
guestOS:CentOS7 64bit
IP:192.168.1.105
VMware® Player 7.1.0 build-2496824
Virtual Machine Settings-->Hardware-->Processors-->Number of precessors cores:4
Network Adapter-->Network connection-->Bridged
先以CPUz查看CPU是否支援VT-x技術,若有將BIOS開起此功能,即可安' 64bit guestOS。
練習1:
無法ping win7:
控制台-->系統及安全-->windows防火牆-->進階設定-->輸入規則
啟用 檔案及印表機共用(回應要求-ICMPv4-IN) 設定檔:私人,共用 1項即可
windows10:
控制台-->系統及安全-->windows防火牆-->進階設定-->輸入規則
啟用 檔案及印表機共用(回應要求-ICMPv4-IN) 設定檔:私人,公用 -->啟用規則
練習2:
//網路相關資料,取代ifconfig
#ip addr
# ip address show
//檢視網路介面卡的相關內容 , -s 顯示裝置統計數字
# ip -s link
//啟用網路介面卡 up:開 down:關
# ip link set ens33 up
# nmcli device status //顯示所有 NetworkManager 辨識到的裝置及它們目前的狀態
# nmcli device connect ens33 //啟用網卡
# nmcli device disconnect ens33 //停用網卡
# vi /etc/sysconfig/network-scripts/ifcfg-ens33 //配置靜態IP
.
.
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens33"
UUID="e9c15129-734f-4ae2-a96e-b0d0cf507c17"
DEVICE="ens33"
ONBOOT="yes"
IPADDR="192.168.2.7"
PREFIX="24"
GATEWAY="192.168.2.1"
DNS1="163.28.136.14"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"
.
或者使用
# nmtui
pietty 畫面亂掉
選項-->亞洲語系修正-->取消 Unicode亞洲寬符號字元
# systemctl restart network.service
# ip addr
//路由
# ip route show | column -t > kkRouteTab.txt
# cat kkRouteTab.txt
//先認識路由表再來試試
# ip route | column -t
# ip route add 10.15.150.0/24 via 192.168.2.1 dev ens33 //增加靜態路由
# ip route | column -t
# ping 10.15.150.1
# ip route del 10.15.150.0/24 //刪除靜態路由
//設置永久靜態路由
// ip route add 對路由修改不能保存,重啟就沒了
//加入重啟電腦或重新啟用網卡才能生效
# echo "ip route add 10.15.150.0/24 via 192.168.2.1 dev ens33" >/etc/sysconfig/network-scripts/route-ens33
# cat /etc/sysconfig/network-scripts/route-ens33
# nmcli device connect ens33
# ip -6 route //IPv6 Route Table
# tracepath 168.95.1.1 //traceroute
# ss -antp | column -t //對應 netstat -antp
# ss -t //TCP 連線
# ss -tl //TCP listen
# ss -ul //UDP listen
//查閱系統核心版本
# uname -a
Linux kk2.centos7 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
CentOS7 最小安裝 並沒ifconfig 及 netstat
# yum install net-tools
# netstat -r //顯示路由表
# yum install -y bind-utils
# dig 163.32.159.2
# yum install -y traceroute
# traceroute www.chehjh.kh.edu.tw //了解與目標主機連線,需經過哪些節點
練習3:
# rpm -qa | grep vim
# yum install vim*
練習4:網路設定
# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
# systemctl restart network
練習5:systemctl
# systemctl --help
# systemctl list-units //查詢目前所有已啟動的服務
# systemctl list-units -a //查詢目前所有已啟動及未啟動的服務
# systemctl list-unit-files //查詢服務啟動或是關閉狀態,以檔名顯示
# systemctl enable firewalld.service //設定開機啟動xxx.service
# chkconfig firewalld on //設定 firewalld 開機時啟動,且不加.service
# systemctl disable firewalld.service //設定開機不啟動xxx.service
# chkconfig firewalld off //設定 firewalld 開機時不要啟動
# systemctl is-enabled firewalld.service //查詢服務是否設定開機啟動
# systemctl stop firewalld.service //立即停止xxx.service
# systemctl start firewalld.service //立即啟動xxx.service
# systemctl is-active firewalld.service //查詢服務是否正常啟動
# systemctl status firewalld.service
練習6:關閉SELINUX
# vim /etc/sysconfig/selinux
SELINUX=disabled
# sestatus
SELinux status: disabled
練習7:journalctl 日誌檢視說明
# journalctl -n //列出最後10行資料
# journalctl -n 20 //列出最後20行資料
# journalctl -xn //列出最後事件,並提供相關解決問題資訊
# journalctl --follow //持續列出最後10行事件記錄
//有點像 tail -n 10 -f /var/log/message
練習8:修改主機名稱
# hostname
# vi /etc/hostname
# hostname
練習9:安裝 dig 指令
# yum install bind-utils
練習10:修改dns設定
# vi /etc/resolv.conf
練習11:
# yum install -y wget
# yum install -y lftp
練習12:排程
//(一)使用者的設定
# crontab -e //-u:設定cron 服務 -l:列出內容 -r:刪除 -e:編輯
13 08 * * * /sbin/shutdown -r now //每天08:13重新開機
43 08 * * * /sbin/yun update -y
//分 時 日 月 星期(0:週日 ~ 6:週六) 指令
//3,6:3時和6時 3-6:3~6時 *:每1小時 */2:每2小時
# tail /var/log/cron
//(二)系統的設定檔
# vi /etc/crontab
....
30 07 * * * root yum update -y ; yum clean packages
//分 時 日 月 星期(0:週日 ~ 6:週六) 身分 指令
# systemctl restart crond
# tail /var/log/cron
練習13:vim
# yum install -y vim
# vim ~/.vimrc
//set hlsearch "高亮度反白
//set backspace=2 "可隨時用倒退鍵刪除
//set autoindent "自動縮排
set ruler "可顯示最後一列的狀態
set showmode "左下角那一列的狀態
set nu "可以在每一列的最前面顯示行號啦!
set bg=dark "顯示不同的底色色調
syntax on "進行語法檢驗,顏色顯示。
# vim /etc/httpd/conf/httpd.conf
練習14:防火牆具FirewallD
# firewall-cmd --state //查詢啟用狀態
#firewall-cmd --zone=public --list-all //了解目前zone的詳細設定
# firewall-cmd --zone=public --add-service=ftp //將服務加入規則
# firewall-cmd --zone=public --add-port=8080/tcp //將埠口加入規則
# firewall-cmd --zone=public --list-all
# firewall-cmd --zone=public --remove-service=ftp //將服務與埠口移除
# firewall-cmd --zone=public --remove-port=8080/tcp
# firewall-cmd --zone=public --list-all
# systemctl is-enabled firewalld.service // firewalld.service 開機是否啟動
# systemctl disable firewalld.service // firewalld.service 開機不啟用
# systemctl enable firewalld.service // firewalld.service 開機即啟用
# systemctl is-enabled firewalld.service
# systemctl start firewalld.service
# systemctl stop firewalld.service //停止FirewallD服務
# systemctl is-active firewalld.service //是否啟用中
# systemctl status firewalld.service
練習15:date
# date
二 2月 7 10:15:46 CST 2017 //錯誤
# date 030210162016 //更改日期間 MMDDhhmmYYYY 月日時分年
//3月2日10時16分2016年
# hwclock -r //查看 BIOS 時間
西元2017年02月07日 (週二) 10時22分38秒 -0.953754 秒 //仍是錯誤
# hwclock -w //將新日期時間寫入到 BIOS 時間
練習16:xwindow
centos7最小安裝Cli mode,更改為GNOME Gui mod
# yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
# ln -sf /lib/systemd/runlevel5.target /etc/systemd/system/default.target
# reboot
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝Apache
# yum install httpd
# rpm -qa | grep httpd
httpd-tools-2.4.6-31.el7.centos.x86_64
httpd-2.4.6-31.el7.centos.x86_64
# systemctl start httpd.service
#systemctl enable httpd.service
# systemctl status httpd
//舊指令# netstat -tunlp
-----防火牆加入http
# firewall-cmd --list-all
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --reload
# firewall-cmd --list-all
由 hostOS win7
http://192.168.1.105/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
設定虛擬目錄
//因未找到SELinux放行規則
//所以先關閉SELINUX
//20160715似乎不用SELinux放行規則
#mkdir /home/test
#cd /home/test
# vi /home/test/index.html
this is Visual DIr
//#touch fille02 file02 file03
# vim /etc/httpd/conf/httpd.conf
...
Alias /test "/home/test"
//此部份設定正確即可
<Directory "/home/test">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
...
# systemctl restart httpd
//似乎無用到
# getsebool -a | grep http
# setsebool -P httpd_enable_homedirs=1
# getsebool -a | grep http
# ls -Z /home/test
-rw-r--r--. root root unconfined_u:object_r:
home_root_t:s0 index.html
# chcon -R -t httpd_sys_content_t /home/test
# ls -Z /home/test
-rw-r--r--. root root unconfined_u:object_r:
httpd_sys_content_t:s0 index.html
//此法 以root在 /home底下新增的目錄有效
// 以root在 / 底下新增的目錄亦有效
//以新增帳號時,所建立的目錄無效
http://192.168.1.105/test/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UserDir個人網頁
# useradd kk2
# passwd kk2 (123456)
# mkdir /home/kk2/public_html
# vim /home/kk2/public_html/index.html
# chmod 755 /home/kk2
# vim /etc/httpd/conf.d/userdir.conf
...
# UserDir disabled
...
UserDir public_html
...
# systemctl restart httpd
# tail /var/log/httpd/error_log
# tail /var/log/messages
//似乎不用
//解決 SELinux 的規則放行問題
# getsebool -a | grep httpd
# setsebool -P httpd_can_network_connect=1
http://192.168.1.105/~kk2/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VirtualHost 虛擬主機
# vim /etc/httpd/conf/httpd.conf
...
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName 192.168.1.105 //原來主機會受到加入的虛擬主機影響
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/asus
ServerName web.asus.com.tw
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/acer
ServerName web.acer.com.tw
</VirtualHost>
<Directory "/var/www/asus">
Options Indexes
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/acer">
Options Indexes
AllowOverride None
Require all granted
</Directory>
...
# sysemctl reload httpd
# mkdir /var/www/asus
# mkdir /var/www/acer
# echo "<h2>Asus web</h2>" > /var/www/asus/index.html
# echo "<h2>Acer web</h2>" > /var/www/acer/index.html
修改win7 hosts 檔
開始-->所有程式-->附屬應用程式-->記事本 右鍵-->以系統管理員身分執行
開啟記事本後-->檔案-->開啟舊檔:C:\Windows\System32\drivers\etc\host
新增資料:
192.168.1.105 web.asus.com.tw web.acer.com.tw
完成後-->檔案-->儲存檔案
即可順利存檔
win7:
http://web.asus.com.tw/
http://web.acer.com.tw/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝vsftp
# useradd kk1
# passwd kk1 (123456)
# ls /home
# yum install vsftpd
# rpm -qa | grep vsftpd
vsftpd-3.0.2-9.el7.x86_64
# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
...
chroot_local_user=YES
...
pasv_enable=NO //允許client以FileZilla及 檔案總管 連線
allow_writeable_chroot=YES
# systemctl start vsftpd
# systemctl enable vsftpd
# systemctl status vsftpd
# firewall-cmd --permanent --zone=public --add-service=ftp
# firewall-cmd --reload
# firewall-cmd --list-all
或者關閉firewall
# systemctl stop firewalld.service
# systemctl status firewalld.service
//SELinux設定
# getsebool -a | grep ftp
ftp_home_dir --> off
....
# setsebool -P ftp_home_dir=1
# getsebool -a | grep ftp
ftp_home_dir --> on
....
或者關閉SELinux
# vim /etc/sysconfig/selinux
SELINUX=disabled
//vsftpd access /var/www/html
//-M: 不要建立使用者家目錄 -d: 指定某個目錄為家目錄,而不使用預設目錄。
# useradd -d /var/www/html web
# passwd web //web123456
# chown -R web:web /var/www/html
# ls -l /var/www
drwxr-xr-x. 3 web web 96 11月 21 10:54 html
# setsebool -P ftpd_full_access=on
# getsebool -a | grep ftp
.
ftpd_full_access --> on
.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝php
# yum install php php-devel php-mysql php-mbstring
# rpm -qa | grep php
php-5.4.16-36.el7_1.x86_64
php-pdo-5.4.16-36.el7_1.x86_64
php-devel-5.4.16-36.el7_1.x86_64
php-mysql-5.4.16-36.el7_1.x86_64
php-common-5.4.16-36.el7_1.x86_64
php-mbstring-5.4.16-36.el7_1.x86_64
php-cli-5.4.16-36.el7_1.x86_64
# systemctl reload httpd
# vim /var/www/html/test.php
http://192.168.1.105/test.php
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝MariaDB
# yum info MariaDB-server
...
Version : 5.5.41 //非目前最新版
...
# vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
//新增MariaDB10套件庫
//以上參考 https://downloads.mariadb.org/mariadb/10.0.24/ 網頁內
// For best results with RPM packages, use the Repository Configuration Tool. -->
// CentOS-->CentOS 7 (64-bit)
# yum install MariaDB-server MariaDB-client
# rpm -qa | grep MariaDB
MariaDB-client-10.0.20-1.el7.centos.x86_64
MariaDB-common-10.0.20-1.el7.centos.x86_64
MariaDB-server-10.0.20-1.el7.centos.x86_64
若使用
# yum -y install MariaDB
# rpm -qa | grep MariaDB
MariaDB-client-10.1.20-1.el7.centos.x86_64
MariaDB-server-10.1.20-1.el7.centos.x86_64
MariaDB-common-10.1.20-1.el7.centos.x86_64
MariaDB-shared-10.1.20-1.el7.centos.x86_64
# systemctl start mysql
//第1次設定root登入mysql密碼
# mysqladmin -u root password db123456 //設定root登入mysql密碼
# mysql -u root -p //以root帳號登入mysql
MariaDB [(none)]> show databases;
MariaDB [(none)]> quit
//第1次後,再設定root登入mysql密碼
# mysql -u root -p
Enter password: //輸入原密碼
MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('db123456');
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//2016-04-15 MariaDB練習匯入資料
# yum install -y mariadb-server
# rpm -qa | grep mariadb
mariadb-5.5.47-1.el7_2.x86_64
mariadb-server-5.5.47-1.el7_2.x86_64
mariadb-libs-5.5.47-1.el7_2.x86_64
# systemctl start mariadb.service
# systemctl is-active mariadb.service
active
# systemctl enable mariadb.service
# systemctl is-enabled mariadb.service
enabled
# mysqladmin -u root password db123456
# mysql -u root -p
Enter password:
MariaDB [(none)]> show databases;
MariaDB [(none)]> create database kkdb; // drop database kkdb;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
MariaDB [(none)]> show engines \G;
MariaDB [(none)]> use kkdb;
Database changed
MariaDB [kkdb]> create table tblmen (mid int primary key auto_increment, na varchar(20), accnt varchar(20), pwd varchar(20));
Query OK, 0 rows affected (0.03 sec)
MariaDB [kkdb]> describe tblmen;
MariaDB [kkdb]> show tables;
MariaDB [kkdb]> insert into tblmen values('','kk1','act1','pwd1'); //mid欄位為auto_increment
Query OK, 1 row affected, 1 warning (0.02 sec)
2016/12/26 insert、update、delete 練習---------------------------------
MariaDB [kkdb]> insert into tblmen (na,accnt,pwd) values ('kk4','act4','pwd4');
MariaDB [kkdb]> update tblmen set na='kk44' ,accnt='act44' ,pwd='pwd44' where mid=4;
MariaDB [kkdb]> delete from tblmen where mid=4;
------------------------------------------------------------------------------
MariaDB [kkdb]> select * from tblmen;
//匯出資料表
MariaDB [kkdb]> select * into outfile 'tblmen.txt' from tblmen;
# ls /var/lib/mysql/kkdb/
db.opt tblmen.frm tblmen.txt
//新增3筆資料,區隔符號 Tab
[root@centos7 ~]# vi /var/lib/mysql/kkdb/tblmen.txt
[tab] kk3 [tab] act3 [tab] pwd4
kk4 act4 pwd4
kk5 act5 pwd5
//匯入文字檔案
MariaDB [kkdb]> load data local infile '/var/lib/mysql/kkdb/tblmen.txt' into table tblmen; Query OK, 3 rows affected, 3 warnings (0.02 sec)
Records: 3 Deleted: 0 Skipped: 0 Warnings: 3
MariaDB [kkdb]> select * from tblmen;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝phpMyAdmin
//# yum install epel-release //需要EPEL套件庫支援
# yum install phpMyAdmin
# rpm -qa | grep phpMyAdmin
phpMyAdmin-4.4.10-1.el7.noarch
# vim /etc/httpd/conf.d/phpMyAdmin.conf
...
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 192.168.1.101 //允許可登入的client端IP
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
...
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 192.168.1.101 //允許可登入的client端IP
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
...
# systemctl restart httpd
以遠端 ip:192.168.1.101連入
http://192.168.1.105/phpMyAdmin/setup/
建立伺服器-->基本設定-->伺服器名稱-->MariaDBServer
認證-->認證方式-->http -->套用
概要-->設定檔案-->預設語言-->中文Chinese traditional -->儲存
//由~/phpMyAdmin/setup/設定完成後產生的config.inc.php覆蓋phpMyAdmin/主設定檔
#cp /var/lib/phpMyAdmin/config/config.inc.php /etc/phpMyAdmin/
http://192.168.1.105/phpMyAdmin/
資料庫-->建立新資料庫-->kkdb ; utf8_general_ci -->建立
建立資料表-->tblmen -->欄位數:4 -->執行
mid varchar(10) primary
na varchar(10)
accnt varchar(10)
pwd varchar(10)
-->儲存
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝Samba Server
# yum -y install samba samba-client samba-common
# rpm -qa | grep samba
samba-libs-4.1.12-23.el7_1.x86_64
samba-client-4.1.12-23.el7_1.x86_64
samba-common-4.1.12-23.el7_1.x86_64
samba-4.1.12-23.el7_1.x86_64
-----------------------------------2016-12-30
# yum -y install samba
# rpm -qa | grep samba
samba-common-4.4.4-9.el7.noarch
samba-client-libs-4.4.4-9.el7.x86_64
samba-common-tools-4.4.4-9.el7.x86_64
samba-common-libs-4.4.4-9.el7.x86_64
samba-libs-4.4.4-9.el7.x86_64
samba-4.4.4-9.el7.x86_64
----------------------------------
#mkdir -p /samba/data
#chmod -R 755 /samba/data
#chown -R nobody:nobody /samba/data
#ls -l /samba
drwxr-xr-x. 2 nobody nobody 32 7月 30 15:13 Data
#mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
#vi /etc/samba/smb.conf
.
//最末加入
[global]
workgroup = WORKGROUP
server string = Samba Server %v
#netbios name = centos
security = user
map to guest = bad user
dns proxy = no
#===== Share Definitions ====
[Samba分享]
path = /samba/data
browsable =yes
writable = yes
guest ok = yes
read only = no
#systemctl start smb.service
#firewall-cmd --permanent --zone=public --add-service=samba
#firewall-cmd --reload
win7:
檔案總管-->網址列--> \\192.168.2.9 -->Samba分享
//Further we need to allow the selinux for the samba configuration as follows:
#chcon -t samba_share_t /samba/data
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
在Linux存取Windows分享的資料夾 - smbclient
win7
一、 c:\share -->右鍵-->內容-->共用-->共用-->新增everyone帳號 權限:讀取/寫入-->共用-->完成-->關閉
二、 開始-->控制台-->網路和網際網路-->選擇家用群組和共用選項-->變更進階共用設定-->關閉以密碼保護的共用-->儲存變更-->確定
# smbclient //192.168.2.10/share -U everyone
Enter everyone's password: //everyone沒密碼直接按Enter
smb: \>
//將win7分享資料夾掛載到centos
# yum -y install cifs-utils
//A default CentOS 7 build will not be able to mount SMB\CIFS shares, unless you customized the install. We’ll need to install a package onto the server that allows it to understand the SMB protocol.
# mkdir /mnt/sysbk
# mount.cifs //192.168.2.10/share /mnt/sysbk -o username=everyone
#df
.
//192.168.2.10/share 62910508 31345608 31564900 50% /mnt/sysbk
.
# cp anaconda-ks.cfg /mnt/sysbk
檢查 win7 c:\share\anaconda-ks.cfg
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
安裝 bind server
# rpm -qa | grep bind
# yum install bind bind-utils
# rpm -qa | grep bind
bind-license-9.9.4-18.el7_1.3.noarch
bind-utils-9.9.4-18.el7_1.3.x86_64
bind-9.9.4-18.el7_1.3.x86_64
bind-libs-9.9.4-18.el7_1.3.x86_64
bind-libs-lite-9.9.4-18.el7_1.3.x86_64
# vi /etc/named.conf
.
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
.
allow-query { 192.168.2.0/24; };
allow-recursion { 192.168.2.0/24; };
.
# systemctl restart named.service
# firewall-cmd --list-all
# firewall-cmd --permanent --add-port=53/udp
# firewall-cmd --permanent --add-port=53/tcp
# firewall-cmd --reload
//centos7本機測試
# dig @192.168.2.9 www.kh.edu.tw
//win7測試
先將DNS設定為192.168.2.9
(一)
C:\Users\User>nslookup
> server 192.168.2.9
DNS request timed out.
timeout was 2 seconds.
預設伺服器: [192.168.2.9]
Address: 192.168.2.9
> www.kh.edu.tw
伺服器: [192.168.2.9]
Address: 192.168.2.9
未經授權的回答:
名稱: www.kh.edu.tw
Addresses: 2001:288:8201:2::5
163.32.250.5
>exit
(二)
http://www.kh.edu.tw/
//Forward Zone
# vi /etc/named.rfc1912.zones
...
zone "502.kk" IN {
type master;
file "502.kk";
};
# vi /var/named/502.kk
$TTL 3H
@ IN SOA 502.kk root.gmail.com. (
0
3H
1H
1W
3H )
@ IN NS dns.502.kk.
dns.502.kk. IN A 192.168.1.105
www IN A 192.168.1.105
ftp IN CNAME dns.502.kk.
# systemctl restart named
# dig @192.168.1.105 dns.502.kk
# dig @192.168.1.105 ftp.502.kk
# dig @192.168.1.105 www.502.kk