假設一個跨國企業網站
讓來自台灣的訪客可以造訪台灣機房
來自日本的訪客可以造訪日本機房
其餘的訪客造訪另一個機房

cd /etc
wget http://geoip.site/download/MaxMind/GeoIP.acl

vi named.conf

include "/etc/GeoIP.acl";
view "TW" {
  match-clients { TW; };
  zone "TW-myip.pass.tw" {
    type master;
    file "JP.myip.pass.tw.zone";
  };
};

view "JP" {
  match-clients { JP; };
  zone "JP-myip.pass.tw" {
    type master;
    file "JP.myip.pass.tw.zone";
  };
};

view "ANY" {
  match-clients { any; };
  zone "ANY-myip.pass.tw" {
    type master;
    file "JP.myip.pass.tw.zone";
  };
};

最後重啟named 即可
 

arrow
arrow
    文章標籤
    dns geoip bind view gslb
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()