1. 개요

업스트림 서버의 URL 이름을 IP 주소로 변경하는데 사용하는 DNS 서버를 지정하는 설정이다.


2. 설정

resolver 127.0.0.1 [::1]:5353;
  • 만약 명시적으로 포트가 설정되어 있지 않으면 53 포트를 사용한다.
  • 1.1.17 이전 버전에는 오직 단일 DNS 서버만 설정할 수 있었다.
  • DNS 서버들은 라운드 로빈 방식으로 쿼리된다.
  • 1.3.1과 1.2.2 이후 버전부터는 IPv6 기반의 DNS 서버도 사용할 수 있다.

3. 설명

  • resolver 설정이 없으면 초기에  resolve된 결과를 계속 사용한다.
  • resolver 설정을 하면 해당 레코드의 TTL 값만큼 사용한다.
  • valid 파라미터를 조합하여 사용하면 resolve 주기를 명시적으로 설정할 수 있다.

4. Apache HTTP Server

아파치 웹 서버 사용 시에 DNS 캐시가 이슈인 경우가 있다. mod_proxy를 사용하고 있다면 disablereuse 옵션을 사용한다. default는 off이며, on으로 설정한다.

This parameter should be used when you want to force mod_proxy to immediately close a connection to the backend after being used, and thus, disable its persistent connection and pool for that backend. This helps in various situations where a firewall between Apache httpd and the backend server (regardless of protocol) tends to silently drop connections or when backends themselves may be under round- robin DNS. When connection reuse is enabled each backend domain is resolved (with a DNS query) only once per child process and cached for all further connections until the child is recycled. To disable connection reuse, set this property value to On.

disablereuse를 설정하면 각 Connection마다 DNS resolution을 하게 된다. (만약 reuse를 하면 각 child process가 최초 1번만 DNS resolution을 하게 됨)

mod_proxy의 ProxyPass 절에서 max, ttl 옵션 등이 함께 사용될 수 있다.