Итак, предположим у нас есть чистый, свежеустановленая FreeBSD или выше с установленым из коробки bind 9.х (у меня FreeBSD 9.0, bind 9.8.1). Правим /etc/named.conf:
Код: Выделить всё
options {
listen-on port 53 { 127.0.0.1; <ваш_IP_на_котором_будет_висеть_бинд>; };
listen-on-v6 { none; }; // IPv6 нам нафиг не нужен)))
directory "/etc/namedb/working"; // Дефолтные директории для FreeBSD
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
memstatistics-file "/var/stats/named.mem";
allow-query { any; };
recursion yes;
version "MySuperDNS 1.0";
// allow-transfer {
// тут_можно_прописать_адрес_вторичного_сервера;
// };
};
logging {
channel security_channel {
file "/var/log/named_security.log" versions 3 size 100m; // Пути к логам. Подправьте если у вас другие
severity info;
print-time yes;
};
channel audit_log {
file "/var/log/named_audit.log" versions 3 size 100m;
severity debug;
print-time yes;
};
channel default_syslog {
file "/var/log/named_default.log" versions 3 size 100m;
severity debug;
print-time yes;
};
channel dnssec_log {
file "/var/log/named_dnssec.log" size 20m;
print-time yes;
print-category yes;
print-severity yes;
severity debug 3;
};
category dnssec { dnssec_log; };
category xfer-in { audit_log; };
category xfer-out { audit_log; };
category security { security_channel; default_syslog; default_debug; };
category lame-servers { security_channel; default_syslog; default_debug; };
};
// Управлялка)))
key "rndc-key" {
algorithm hmac-md5;
secret "e+DIfj33HaGvBdvdhnD+Tw==";
};
// Корневые зоны. Не забывайте раз в месяц проверять обновления этого файла
zone "." IN {
type hint;
file "/etc/namedb/named.root";
};
// Локальные зоны.
zone "localhost" {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "127.in-addr.arpa" IN {
type master;
file "127.zone";
notify no;
};
// Далее самое интересное - зоны:
// blogblog.com
zone "blogblog.com" IN {
type master;
notify no;
file "master/blogblog.com.zone";
allow-update { none; };
allow-query { any; };
};
// blogger.com
zone "blogger.com" IN {
type master;
notify no;
file "master/blogger.com.zone";
allow-update { none; };
allow-query { any; };
};
// blogspot.com
zone "blogspot.com" IN {
type master;
notify no;
file "master/blogspot.com.zone";
allow-update { none; };
allow-query { any; };
};
// code.l.google.com
zone "master/code.l.google.com" IN {
type master;
notify no;
file "code.l.google.com.zone";
allow-update { none; };
allow-query { any; };
};
// googlehosted.l.google.com
zone "master/googlehosted.l.google.com" IN {
type master;
notify no;
file "master/googlehosted.l.google.com.zone";
allow-update { none; };
allow-query {any; };
};
// googlehosted.l.googleusercontent.com
zone "googlehosted.l.googleusercontent.com" IN {
type master;
notify no;
file "master/googlehosted.l.googleusercontent.com.zone";
allow-update { none; };
allow-query { any; };
};
// googlemail.l.google.com
zone "googlemail.l.google.com" IN {
type master;
notify no;
file "master/googlemail.l.google.com.zone";
allow-update { none; };
allow-query { any; };
};
// photos-ugc.l.google.com
zone "photos-ugc.l.google.com" IN {
type master;
notify no;
file "master/photos-ugc.l.google.com.zone";
allow-update { none; };
allow-query { any; };
};
// www-google-analytics.l.google.com
zone "www-google-analytics.l.google.com" IN {
type master;
notify no;
file "master/www-google-analytics.l.google.com.zone";
allow-update { none; };
allow-query { any;};
};
// www3.l.google.com
zone "www3.l.google.com" IN {
type master;
notify no;
file "master/www3.l.google.com.zone";
allow-update { none; };
allow-query { any; };
};
// ytimg.l.google.com
zone "ytimg.l.google.com" IN {
type master;
notify no;
file "master/ytimg.l.google.com.zone";
allow-update { none; };
allow-query { any; };
};
// ytstatic.l.google.com
zone "ytstatic.l.google.com" IN {
type master;
notify no;
file "master/ytstatic.l.google.com.zone";
allow-update { none; };
allow-query { any; };
};
// wordpress.com
zone "wordpress.com" {
type master;
notify no;
file "master/wordpress.com.zone";
allow-update { none; };
allow-query { any; };
};
// liveinternet.com
zone "liveinternet.com" {
type master;
notify no;
file "master/liveinternet.com.zone";
allow-update { none; };
allow-query { any; };
};
// liveinternet.ru
zone "liveinternet.ru" {
type master;
notify no;
file "master/liveinternet.ru.zone";
allow-update { none; };
allow-query { any; };
};
// livejournal.com
//zone "livejournal.com" {
// type master;
// notify no;
// file "master/livejournal.com.zone";
// allow-update { none; };
// allow-query { any; };
//};
blogblog.com.zone
Код: Выделить всё
$TTL 86400
$ORIGIN blogblog.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
*.blogblog.com. A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN blogger.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
MX 10 gmr-smtp-in.l.google.com.
TXT "v=spf1 include:_netblocks.google.com -all"
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
*.blogger.com. A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN blogspot.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
*.blogspot.com. A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN code.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
www A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN googlehosted.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
*.googlehosted.l.google.com. A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN googlehosted.l.googleusercontent.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
*.googlehosted.l.googleusercontent.com. A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN googlemail.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
*.googlemail.l.google.com. A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN photos-ugc.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN www-google-analytics.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN www3.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN ytimg.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN ytstatic.l.google.com.
@ IN SOA ns1.google.com. dns-admin.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.google.com.
NS ns2.google.com.
NS ns3.google.com.
NS ns4.google.com.
@ A 212.154.168.240
A 212.154.168.241
A 212.154.168.242
A 212.154.168.243
Код: Выделить всё
$TTL 86400
$ORIGIN wordpress.com.
@ IN SOA ns1.wordpress.com. mmmmmm.google.com. (
2012011701 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
NS ns1.wordpress.com.
NS ns2.wordpress.com.
NS ns3.wordpress.com.
NS ns4.wordpress.com.
@ A 72.233.104.124
A 72.233.104.126
A 76.74.254.124
A 76.74.254.126
*.wordpress.com. A 72.233.104.124
A 72.233.104.126
A 76.74.254.124
A 76.74.254.126
Код: Выделить всё
$TTL 5d
$ORIGIN liveinternet.com.
@ IN SOA liveinternet.com. webmaster.liveinternet.com. (
2012011703 ; Serial
3600 ; Refresh
7200 ; Retry
720000 ; Expire - 1 week
3600 ) ; Minimum
liveinternet.com. IN NS ns.mega.kg.
liveinternet.com. IN NS ns3.mega.kg.
liveinternet.com. IN MX 10 nullmx.liveinternet.com.
liveinternet.com. IN TXT "v=spf1 -all"
liveinternet.com. IN A 184.72.233.153
nullmx.liveinternet.com. IN A 209.181.247.105
*.liveinternet.com. IN A 184.72.233.153
Код: Выделить всё
$TTL 5d
$ORIGIN liveinternet.ru.
@ IN SOA liveinternet.ru. webmaster.liveinternet.ru. (
2012011701 ; Serial
3600 ; Refresh
7200 ; Retry
720000 ; Expire - 1 week
3600 ) ; Minimum
@ IN NS ns.mega.kg.
@ IN NS ns3.mega.kg.
localhost IN A 127.0.0.1
liveinternet.ru. IN MX 5 alt2.aspmx.l.google.com.
liveinternet.ru. IN MX 10 aspmx2.l.google.com.
liveinternet.ru. IN MX 10 aspmx3.l.google.com.
liveinternet.ru. IN MX 10 aspmx4.l.google.com.
liveinternet.ru. IN MX 10 aspmx5.l.google.com.
liveinternet.ru. IN MX 1 aspmx.l.google.com.
liveinternet.ru. IN MX 5 alt1.aspmx.l.google.com.
@ IN A 88.212.196.82
*.liveinternet.ru IN A 88.212.196.82
www IN A 88.212.196.82
img0.liveinternet.ru. IN A 88.212.202.25
img0.liveinternet.ru. IN A 88.212.196.95
img1.liveinternet.ru. IN A 88.212.202.38
img1.liveinternet.ru. IN A 88.212.202.24
img2.liveinternet.ru. IN A 88.212.202.58
img3.liveinternet.ru. IN A 88.212.202.25
img4.liveinternet.ru. IN A 88.212.202.24
img5.liveinternet.ru. IN A 88.212.202.58
img6.liveinternet.ru. IN A 88.212.202.25
img7.liveinternet.ru. IN A 88.212.202.24
img8.liveinternet.ru. IN A 88.212.202.58
img9.liveinternet.ru. IN A 88.212.202.25
img10.liveinternet.ru. IN A 88.212.202.24
img11.liveinternet.ru. IN A 88.212.202.58
Кстати, DNS-серверы интернет провайдера Мегалайн работают уже с учетом данных изменений, так что вы можете просто указать их и не заморачиваться с настройкой бинда.
З.Ы. Зону livejournal.com.zone пока не скидываю - там кое-что изменилось, надо разобраться с этим. Выложу позже.