看了前面的應該知道,由于訪問量大,地域分布廣,這里假設使用了3加運營商介入,分別是網通,電信,還有一個其他接入方式。先分析一下網絡情況,現在我們是3根線路接入,網絡用戶分別來自不同的地方,不同地方的線路速度是不同的,如果電信的用戶一定要從網通的線路來訪問我的站點那就會變得非常緩慢,所以第一個目的就是讓電信的用戶通過電信線路,網通的用戶通過網通線路來訪問,用戶訪問只是通過在瀏覽器中輸入域名來訪問,沒有辦法處理線路上的問題,而數據發出后經過N多路由到達我們的網站,路由會自動選擇最經濟路由,我們也沒辦法處理,那我們只有在域名上想想辦法了。這里使用bind的view功能,配置也不復雜,作用就是根據ip的來源不同解析到不同的ip上去。
1、named.conf文件的配置
配置named.conf,因為涉及到隱私問題,這里就不寫實際地址了,用偽地址代替,下面涉及到的一些查詢權限,zone傳輸,slave服務器配置等大家使用的時候根據實際情況修改。
named.conf
//
//Samplenamed.confBINDDNSserver'named'configurationfile
//fortheRedHatBINDdistribution.
//
//SeetheBINDAdministrator'sReferenceManual(ARM)fordetails,in:
//file:///usr/share/doc/bind-*/arm/Bv9ARM.html
//AlsoseetheBINDConfigurationGUI:/usr/bin/system-config-bindand
//itsmanual.
//
options
{
/*makenameduseport53forthesourceofallqueries,toallow
*firewallstoblockallportsexcept53:
*/
query-sourceaddress*port53;
//query-source-v6port53;
//Putfilesthatnamedisallowedtowriteinthedata/directory:
directory"/var/named";//thedefault
dump-file"data/cache_dump.db";
statistics-file"data/named_stats.txt";
memstatistics-file"data/named_mem_stats.txt";
datasize100M;
allow-query{192.168.0.0/24;2xx.1xx.2xx.0/24;1xx.1xx.1xx.192/24;};
};
logging
{
/*Ifyouwanttoenabledebugging,eg.usingthe'rndctrace'command,
*namedwilltrytowritethe'named.run'fileinthe$directory(/var/named).
*Bydefault,SELinuxpolicydoesnotallownamedtomodifythe/var/nameddirectory,
*soputthedefaultdebuglogfileindata/:
*/
channeldefault_debug{
file"data/named.run";
severitydynamic;
};
};
//
//AllBIND9zonesareina"view",whichallowdifferentzonestobeserved
//todifferenttypesofclientaddresses,andforoptionstobesetforgroups
//ofzones.
//
//Bydefault,ifnamed.confcontainsno"view"clauses,allzonesareinthe
//"default"view,whichmatchesallclients.
//
//Ifnamed.confcontainsany"view"clause,thenallzonesMUSTbeinaview;
//soitisrecommendedtostartoffusingviewstoavoidhavingtorestructure
//yourconfigurationfilesinthefuture.
//
acl"zero-transfer"{192.168.0.0/24;2xx.1xx.2xx.0/24;1xx.1xx.1xx.192/24;};
acl"slave-updata"{192.168.0.0/24;2xx.1xx.2xx.0/24;1xx.1xx.1xx.192/24;};
include"/etc/zone.conf";
#-----------------------------------------#
view"internal"{
match-clients{127.0.0.1;};
recursionno;
zone"localhost"{
typemaster;
file"localhost.zone";
};
zone"0.0.127.IN-ADDR.ARPA"{
typemaster;
file"named.local";
};
};
#-----------------------------------------#
view"cnc"{
match-clients{CNC;};
match-destinations{any;};
recursionyes;
include"/etc/cnc.zones";
include"/etc/cnc.local";
};
view"telecom"{
match-clients{CHINANET;};
match-destinations{any;};
recursionyes;
include"/etc/telecom.zones";
include"/etc/telecom.local";
};
view"other"{
match-clients{any;};
match-destinations{any;};
recursionyes;
include"/etc/other.zones";
include"/etc/other.local";
};
#-----------------------------------------#
include"/etc/rndc.key";
zone.conf:
acl"CNC"{
117.8.0.0/13;
……
123.112.0.0/12;
};
acl"CHINANET"{
222.222.0.0/15
……
222.86.0.0/15
};
*.zones為正向解析配置文件,*.local為反向解析文件,同dns的標準配置。
#-------------------------------------------#
zone"."{
typehint;
file"/var/named/named.root";
};
#------------------------------------------#
zone"56hr.com"IN{
typemaster;
file"cnc/xinyv.com.ndb";
allow-query{any;};
allow-transfer{zero-transfer;};
allow-update{slave-updata;};
};
#-----------------------------------------#
然后分別在不同的文件夾建立相應的ndb數據文件即可。
共2頁: 1 [2] 下一頁 | ||||
|