Linux7.0下簡單DNS服務配置實驗

shanliangdexingxing發表於2015-03-15

1.配置yum

2.安裝DHCP服務

3.修改配置檔案

4.關閉防火牆SELinux(當然也可以設定)

5.重啟DHCP服務

6.檢驗


1.# vi  /etc/yum.repos.d/base.repo

    [base]

    name=base

    baseurl=file:///mnt

    enable=1

    gpgcheck=0

2.掛載  # mount /dev/sr0 /mnt

             # yum install dhcp -y

3. 配置檔案/etc/dhcp/dhcpd.conf 預設是空的

             #cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf

  檔案修改後如下:

   ddns-update-style none;


subnet 172.16.30.0 netmask 255.255.255.0 {
  range 172.16.30.1 172.16.30.30;
  option domain-name-servers 114.114.114.114;
  option domain-name "example.org";
  option routers 172.16.30.1;
  option broadcast-address 172.16.30.255;
  default-lease-time 600;
  max-lease-time 7200;
}                    注意分號及第一個大括號的位置


橋接虛擬機器到同一個環回

4.#systemctl stop firewalld.server

   #setenforce 0

5.#systemctl restart dhcpd.server

6.將DHCP改為自動獲取



相關文章