Hello comrade,
today I will show you the DNS infrastructure evolution for a project. This post is dedicated to bind 9.11 stable which was released on the 4th of October.
Few servers
Few - two or more. All registrars request at least two different name servers for a zone.
Add geoIP (with ECS)
Your project grows and you need to land customers from different countries to different frontends. Best way - use geoIP. Based on the IP-address of the client you will return different IP-addresses of your frontends.
ECS - EDNS Client Subnet - one of the extensions mechanisms (EDNS0), described in RFC 7871. Till May 2016 it was just a draft, but is widely used since 2014. If a recursive resolver with ECS feature enabled receives the request, it adds the clients IP into DNS packet and sends the request further. The authorative server returns the IP-address (or any other data) based on the client IP from DNS packet, but not the recursive resolver itself. ECS should be enabled on every server on the way of the request.
As you can see from the picture above, for the request from Chinese client via Google public NS (whose IP-address is treated by geoIP as US) the answer is still 4.3.2.1, as it should be for CN.
GeoIP and ECS are enabled easily in bind:
and config views like this:
Add anycast
Now you want to lower the latency between the client and DNS server. Good one. Use BGP anycast. Border routers of the ISPs will route the request to the closest node.
Do not forget to load-balance
Now take care of high-load and redundancy. Add redundant balancers and servers.
today I will show you the DNS infrastructure evolution for a project. This post is dedicated to bind 9.11 stable which was released on the 4th of October.
Few servers
Few - two or more. All registrars request at least two different name servers for a zone.
Add geoIP (with ECS)
Your project grows and you need to land customers from different countries to different frontends. Best way - use geoIP. Based on the IP-address of the client you will return different IP-addresses of your frontends.
ECS - EDNS Client Subnet - one of the extensions mechanisms (EDNS0), described in RFC 7871. Till May 2016 it was just a draft, but is widely used since 2014. If a recursive resolver with ECS feature enabled receives the request, it adds the clients IP into DNS packet and sends the request further. The authorative server returns the IP-address (or any other data) based on the client IP from DNS packet, but not the recursive resolver itself. ECS should be enabled on every server on the way of the request.
As you can see from the picture above, for the request from Chinese client via Google public NS (whose IP-address is treated by geoIP as US) the answer is still 4.3.2.1, as it should be for CN.
GeoIP and ECS are enabled easily in bind:
geoip-directory "/etc/geoip/"; // directory with maxmind .dat file geoip-use-ecs yes;
and config views like this:
acl US { geoip country US; };
acl CN { geoip country CN; };
view US {
match-clients { US; };
zone "yourdomain.com." {
type slave;
file "zones/us_view_yourdomain.com.";
masters {blabla; };
};
};
view CN {
match-clients { CN; };
zone "yourdomain.com." {
type slave;
file "zones/cn_view_yourdomain.com.";
masters {blabla; };
};
};
Add anycast
Now you want to lower the latency between the client and DNS server. Good one. Use BGP anycast. Border routers of the ISPs will route the request to the closest node.
Do not forget to load-balance
Now take care of high-load and redundancy. Add redundant balancers and servers.




No comments:
Post a Comment