Difference between revisions of "DNS Server linux, bind"
From Ilianko
(Created page with "sudo apt-get install bind9 sudo gedit /etc/bind/named.conf.local #### zone "tugab.bg" { type master; file "/etc/bind/zones/tugab.bg.db"; }; zone "4.16.172.in-addr.arpa" { ...") |
|||
Line 1: | Line 1: | ||
− | sudo apt-get install bind9 | + | *sudo apt-get install bind9 |
− | sudo gedit /etc/bind/named.conf.local | + | *sudo gedit /etc/bind/named.conf.local |
#### | #### | ||
− | zone "tugab.bg" | + | |
− | { | + | zone "tugab.bg" |
+ | { | ||
type master; | type master; | ||
file "/etc/bind/zones/tugab.bg.db"; | file "/etc/bind/zones/tugab.bg.db"; | ||
− | }; | + | }; |
− | zone "4.16.172.in-addr.arpa" | + | zone "4.16.172.in-addr.arpa" |
− | { | + | { |
type master; | type master; | ||
− | file "/etc/bind/zones/rev.4.16.172.in-addr.arpa"; | + | file "/etc/bind/zones/rev.4.16.172.in-addr.arpa"; |
− | }; | + | }; |
#### | #### | ||
− | sudo gedit /etc/bind/named.conf.options | + | |
− | + | *sudo gedit /etc/bind/named.conf.options | |
− | forwarders { | + | |
− | 194.141.15.1; | + | forwarders { |
− | }; | + | 194.141.15.1; |
− | sudo mkdir /etc/bind/zones | + | }; |
− | sudo gedit /etc/bind/zones/tugab.bg.db | + | |
+ | *sudo mkdir /etc/bind/zones | ||
+ | *sudo gedit /etc/bind/zones/tugab.bg.db | ||
### | ### | ||
+ | <code></pre> | ||
$TTL 60 | $TTL 60 | ||
tugab.bg. IN SOA n1.tugab.bg. admin.tugab.bg. ( | tugab.bg. IN SOA n1.tugab.bg. admin.tugab.bg. ( | ||
Line 34: | Line 38: | ||
n1 IN A 172.16.4.1 | n1 IN A 172.16.4.1 | ||
www2 IN A 172.16.4.2 | www2 IN A 172.16.4.2 | ||
+ | </pre></code> | ||
### | ### | ||
sudo gedit rev.4.16.172.in-addr.arpa | sudo gedit rev.4.16.172.in-addr.arpa | ||
### | ### | ||
+ | |||
+ | <code><pre> | ||
$TTL 604800 | $TTL 604800 | ||
@ IN SOA n1.tugab.bg. admin.tugab.bg. ( | @ IN SOA n1.tugab.bg. admin.tugab.bg. ( | ||
Line 47: | Line 54: | ||
IN NS tugab.bg. | IN NS tugab.bg. | ||
1 IN PTR tugab.bg. | 1 IN PTR tugab.bg. | ||
+ | </pre></code> | ||
+ | |||
+ | *sudo /etc/init.d/bind9 restart | ||
+ | |||
+ | *sudo vi /etc/resolv.conf | ||
− | + | *dig tugab.com / | |
− | + | *nslookup 172.16.0.1 | |
− | dig tugab.com / nslookup 172.16.0.1 |
Revision as of 16:56, 13 August 2011
- sudo apt-get install bind9
- sudo gedit /etc/bind/named.conf.local
zone "tugab.bg" { type master; file "/etc/bind/zones/tugab.bg.db"; }; zone "4.16.172.in-addr.arpa" { type master; file "/etc/bind/zones/rev.4.16.172.in-addr.arpa"; };
- sudo gedit /etc/bind/named.conf.options
forwarders { 194.141.15.1; };
- sudo mkdir /etc/bind/zones
- sudo gedit /etc/bind/zones/tugab.bg.db
$TTL 60
tugab.bg. IN SOA n1.tugab.bg. admin.tugab.bg. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
tugab.bg. IN NS n1.tugab.bg.
@ IN A 172.16.4.1
n1 IN A 172.16.4.1
www2 IN A 172.16.4.2
sudo gedit rev.4.16.172.in-addr.arpa
$TTL 604800
@ IN SOA n1.tugab.bg. admin.tugab.bg. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS tugab.bg.
1 IN PTR tugab.bg.
- sudo /etc/init.d/bind9 restart
- sudo vi /etc/resolv.conf
- dig tugab.com /
- nslookup 172.16.0.1