ubuntu 安裝DNS

 

安裝DNS

sudo apt-get install bind9

 

配置文件

  1. sudo gedit /etc/resolv.conf

    # Generated by NetworkManager

    # nameserver 61.134.1.4

    nameserver 10.163.142.223(本機IP)

     

  2. Sudo gedit /etc/bind/named.conf.local

//

// Do any local configuration here

//

// Consider adding the 1918 zones here, if they are not used in your

// organization

//include "/etc/bind/zones.rfc1918";

zone "k.m" {

type master;

file "/etc/bind/db.k.m";

};

 

3.sudo gedit /etc/bind/db.k.m

;

; BIND data file for local loopback interface

;

$TTL 604800

@ IN SOA localhost. root.localhost. (

2 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS localhost.

@ IN A 10.163.142.223

www IN A 127.0.0.1

 

  1. 重啓DNSsudo /etc/init.d/bind9 restart

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章