안녕리눅스 3 User Guide
  • Introduction
  • Chapter 1. 안녕 리눅스 3 \/ CentOS 7.2 차이점
  • Chapter 2. Access Control
    • 안녕 리눅스 방화벽 설정
      • 기본 설정
      • Inbound 제어
      • Outbound 제어
      • brute force attack 제어
      • User defined rule 제어
      • 특정 국가에서의 접속 제어
      • oops-firewall 실행 방법
    • Shell login Control (with PAM)
      • login 가능한 account 제한
      • login account chroot
      • Google OTP를 이용한 2 factor 인증
    • 인증 통합 (Authentification\/Authorization Intergrate)
      • Openldap
        • Master Server 설정
        • SSL 설정
        • Slave Server 설정
        • Replication 설정
        • LDAP 클라이언트 인증 연동 설정
        • LDAP data 관리
        • Sudo LDAP 연동
      • NIS
      • Active Directory
  • Chapter 3. Web control
    • httpd
    • nginx
    • lighttpd
    • PHP
    • Web Access Control
      • Apache 2.4
      • Nginx
      • lighttpd
    • Web Monitor agent
  • Chapter 4. JVM 운영
  • Chapter 5. DNS 운영
    • 기본 설정
    • 신규 도메인 설정
    • Slave DNS 구성
    • Inverse Domain 설정
    • DNSSEC 설정
    • GeoDNS 설정
    • Domain 위임
    • IDN
    • Troble Shooting
  • Chapter 6. Time Server 운영
    • Chrony
    • NTP
  • Chapter 7. VPN 운영
  • Chapter 8. SMTP 운영
  • 안녕 리눅스 White Paper
    • Disk Partition Aligment
  • 안녕 리눅스 알려진 버그
  • 안녕 리눅스 3 패키지 일람
    • [AN:core]
      • annyung-release
      • byspam
      • check-utils
      • genpasswd
      • httpd-conf
      • httpd-krisp
      • httpd-nis
      • httpd-url
      • kmod-geoip
      • l4vip
      • ldap-auth-utils
      • libchardet
      • libimginfo
      • libipcalc
      • libkrisp
      • mariadb-aes256
      • olibc
      • oops-firewall
      • perl-KRISP
      • perl-ModuleList
      • php-chardet
      • php56-chardet
      • php71-chardet
      • php-common
      • php56-common
      • php71-common
      • php-fpm-conf
      • php56-fpm-conf
      • php71-fpm-conf
      • php-geoip
      • php56-geoip
      • php71-geoip
      • php-korean
      • php56-korean
      • php71-korean
      • php-krisp
      • php56-krisp
      • php71-krisp
      • php-nis
      • php56-nis
      • php71-nis
      • php-pear-KSC5601
      • php-pear-ipcalc
      • php-pear-krisp
      • php-pear-oops-key
      • procdump
      • python-chardet
      • python-krisp
      • remount
      • utf8-profile
      • whois
      • yum-annyung
    • [AN:base]
      • apr
      • authconfig
      • bash
      • bind
      • chrony
      • coreutils
      • ctags
      • cvs
      • ecj
      • filesystem
      • GeoIP
      • gperftools
      • httpd
      • initscrtips
      • iptables
      • java-1.8.0-openjdk
      • javapacakges-tools
      • linuxdoc-tools
      • mariadb
      • memcached
      • net-tools
      • ntp
      • openssh
      • openssl
      • pam
      • php
      • procmail
      • procps-ng
      • redhat-rpm-config
      • rootfiles
      • rsyslog
      • sendmail
      • setup
      • shadow-utils
      • sudo
      • systemd
      • sysvinit-tools
      • tomcat
      • traceroute
      • unzip
      • util-linux
      • vim
      • xinted
    • [AN:xless]
    • [AN:addon]
      • authbind
      • cronolog
      • google-authenticator
      • hping3
      • httpd-fcgid
      • imap
      • jfbterm
      • jlint
      • libevent14
      • libnet
      • libnetfilter_acct
      • lighttpd
      • mhash
      • mimetex
      • mm
      • netdata
      • netperf
      • nginx
      • openvpn
      • pdnsd
      • perl-CSS-DOM
      • php-pecl-apcu
      • php56-pecl-apcu
      • php71-pecl-apcu
      • php-pecl-memcache
      • php56-pecl-memcache
      • php71-pecl-memcache
      • php-pecl-oauth
      • php56-pecl-oauth
      • php71-pecl-oauth
      • php-pecl-xdebug
      • php56-pecl-xdebug
      • php71-pecl-xdebug
      • php56
      • php71
      • proftpd
      • python-Mako
      • python-MarkupSafe
      • python-mcrypt
      • python-openpyxl
      • python-xlrd
      • re2c
      • redis
      • rudiments
      • splint
      • sqlite32
      • sqlrelay
      • tomcat-native
    • [AN:plus]
  • 안녕 리눅스 Upgrade Guide
Powered by GitBook
On this page
  • 5.6.1 GeoDNS 란?
  • 5.6.2 GeoDNS 설정

Was this helpful?

  1. Chapter 5. DNS 운영

GeoDNS 설정

PreviousDNSSEC 설정NextDomain 위임

Last updated 5 years ago

Was this helpful?

5.6.1 GeoDNS 란?

주의:

안녕 리눅스 3.5 (CentOS 7.7) 부터는 GeoDNS 방식이 기존의 Google GeoDNS 방식에서 ISC GeoDNS 방식으로 변경 되었습니다. bind 버전이 9.11 이상 이라면 를 참고 하십시오. 현재 이 문서 는 deprecated 되어진 Google GeoDNS 방식을 기술하고 있습니다.

GeoDNS 기능은, GeoIP의 database를 이용하여 조건에 따라 다른 응답을 하는 기능을 의미 합니다.

예를 들어, 한국에서 접근을 했을 때에는 한국에 있는 서버의 IP를 반환고, 한국이 아닌 곳에서 접근을 했을 경우에는 미국에 있는 서버의 IP를 반환 하도록 설정을 할 수 있습니다.

이 기능을 제대로 사용하기 위해서는 주기적은 GeoIP database 갱신이 필요 합니다.

사용할 수 있는 GeoIP database는 다음과 같습니다.

  • Country

  • City

  • Region

  • ISP

  • Organization

  • AS number

  • Netspeed

  • Domain

  • Country IPv6

RHEL 7.3 또는 CentOS 7.3 부터 bind에 GeoDNS 기능을 제공합니다. 하지만, 안녕 리눅스의 경우, RHEL 또는 CentOS 보다 먼저 이 기능을 제공하기 시작했으며, 제공하는 방식이 다릅니다. 그래서 RHEL 7.3 기반인 안녕 리눅스의 bind에서는 안녕 리눅스 2/3의 하위 호환성을 위하여 RHEL 7.3의 방식과는 다른 방식으로 제공합니다.

5.6.2 GeoDNS 설정

GeoDNS 기능은 bind의 view 기능을 이용하여 제공 합니다. view 기능은 client의 특정 상태에 따라 다른 응답을 할 수 있도록 하는 기능 입니다.

일단 view 작업은 /var/named/etc/named.user.zones 에서 하도록 합니다. 일단 예제 부터..

view "US" {
    match-clients {
        geoip_countryDB_country_US;
    };

    zone "cdn.mydomain.com" IN {
        type master;
        file "US/cdn.mydoman.com.zone";
    }
};

view "EASTASIA" {
    match-clients {
        geoip_countryDB_country_KR;
        geoip_countryDB_country_JP;
        geoip_countryDB_country_CN;
    };

    zone "cdn.mydomain.com" IN {
        type master;
        file "KR/cdn.mydoman.com.zone";
    };
};

view "default" {
    zone "cdn.mydomain.com" IN {
        type master;
        file "DEF/cdn.mydoman.com.zone";
    }
}

match-clients의 조건에 따라서 설정된 zone 파일을 참조하게 됩니다. match-clients 조건은 다음의 형식으로 GeoIP country를 사용합니다.

geoip_<DBTYPE>DB_<FIELD>_<VALUE>

위의 예제로 보자면 다음과 같습니다.

DBTYPE : geoip
FIELD:   country
VALUE:   국가코드 (ISO 3166-1 alpha-2)

GeoIP database의 country 필드의 값에 따라 다르게 적용을 하라는 의미입니다. 국가 코드는 GeoIP의 country fileld 값인 ISO3166-1 두자리 알파뱃을 이용 합니다.

자세한 사용법에 대해서는 문서를 참고 하시고, 여기서는 국가별 제어에 대한 예제만 다루도록 합니다.

https://kb.isc.org/docs/aa-01149
https://code.google.com/archive/p/bind-geoip/wikis/UsageGuide.wiki