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. 重启DNS:sudo /etc/init.d/bind9 restart

你可能感兴趣的:(ubuntu,安装bind9)