DNS Server를 하나 구성하고 싶어 기웃거리던중 대표적인 DNS로 꼽히는 BIND를 설치해보기로 했다. 
PowerDNS나 dnsmasq도 있으나, 각각 너무 크거나 단순해서 적당히 복잡하고 유명한 BIND를 선택했다. BIND는 여러 버전이 있어 왔지만, 현재 사용되는건 BIND9이고 보통 BIND라고만 하면 BIND9이라고 생각하면 되는것 같다.

CentOS8.2 minimal VM을 한대 구성해서 아래와 같이 진행 내용을 기록한다.

환경
CentOS Linux release 8.2.2004
4.18.0-193.el8.x86_64

BIND9 설치
wget https://downloads.isc.org/isc/bind9/9.16.4/bind-9.16.4.tar.xz
tar xvf bind-9.16.4.tar.xz
cd bind-9.16.4
./configure

 에러발생
configure: error: in `/opt/bind-9.16.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

centos 설치시 minimal로 설치하는 바람에 C compiler가 없다. 
gcc를 설치한다.
yum install gcc

다시 에러발생
configure: error: Python >= 2.7 or >= 3.2 and the PLY package are required for dnssec-keymgr and other Python-based tools. PLY may be available from your OS package manager as python-ply or python3-ply; it can also be installed via pip. To build without Python/PLY, use --without-python.

python도 없다.. python을 설치한다. ply가 필요한거지만, python 설치시 기본 패키지로 설치되는듯 하다.
친숙한 3.6버전으로
yum install python36
pip3 install ply

다시 에러발생
configure: error: libuv not found

yum 으로 libuv를 받아도 정상적으로 인식하지 않는다.
이슈를 보니 라이브러리가 필요한것으로 libuv-devel이 필요하다.
centos 기본 repository에는 libuv-devel이 없으나, epel repository에는 있다. 
yum install epel-release
yum install libuv-devel

다시 에러발생
checking whether compiling and linking against OpenSSL works... no
configure: error: in `/opt/bind-9.16.4':
configure: error: OpenSSL/LibreSSL not found
See `config.log' for more details

openssl관련에러, DNSSEC을 위해서 필요한것 같다. 사용할일은 없을 것 같긴하지만 우선 받는다.
openssl은 있을것이고 openssl-devel이 필요하다.
yum install openssl-devel

다시에러
checking for sys/capability.h... no
configure: error: sys/capability.h header is required for Linux capabilities support. Either install libcap or use --disable-linux-caps.

libcap-devel을 받아준다.
yum install libcap-devel

성공했다.
Configuration summary:
-------------------------------------------------------------------------------
Optional features enabled:
    GSS-API (--with-gssapi)
    Print backtrace on crash (--enable-backtrace)
    Use symbol table for backtrace, named only (--enable-symtable)
    DNSSEC validation active by default (--enable-auto-validation)
    Dynamically loadable zone (DLZ) drivers:
        None
-------------------------------------------------------------------------------
Features disabled or unavailable on this platform:
    Small-system tuning (--with-tuning)
    Allow 'dnstap' packet logging (--enable-dnstap)
    GeoIP2 access control (--enable-geoip)
    DNS Response Policy Service interface (--enable-dnsrps)
    Allow 'fixed' rrset-order (--enable-fixed-rrset)
    Using PKCS#11 for Public-Key Cryptography (--with-native-pkcs11)
    Very verbose query trace logging (--enable-querytrace)
    Use GNU libtool (--with-libtool)
    CMocka Unit Testing Framework (--with-cmocka)
    XML statistics (--with-libxml2)
    JSON statistics (--with-json-c)
    LMDB database to store configuration for 'addzone' zones (--with-lmdb)
    IDN support (--with-libidn2)
-------------------------------------------------------------------------------
Configured paths:
    prefix: /usr/local
    sysconfdir: ${prefix}/etc
    localstatedir: ${prefix}/var
-------------------------------------------------------------------------------
Compiler: gcc
    gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
-------------------------------------------------------------------------------
For more detail, use --enable-full-report.
===============================================================================

이제 빌드해준다.
make

그리고 설치
make install

설치상태 확인
BIND 9.16.4 (Stable Release) <id:0849b42>
running on Linux x86_64 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020
built by make with defaults
compiled by GCC 8.3.1 20191121 (Red Hat 8.3.1-5)
compiled with OpenSSL version: OpenSSL 1.1.1c FIPS  28 May 2019
linked to OpenSSL version: OpenSSL 1.1.1c FIPS  28 May 2019
compiled with zlib version: 1.2.11
linked to zlib version: 1.2.11
threads support is enabled


default paths:
  named configuration:  /usr/local/etc/named.conf
  rndc configuration:   /usr/local/etc/rndc.conf
  DNSSEC root key:      /usr/local/etc/bind.keys
  nsupdate session key: /usr/local/var/run/named/session.key
  named PID file:       /usr/local/var/run/named/named.pid
  named lock file:      /usr/local/var/run/named/named.lock

정상적으로 설치 완료되면 다음은 셋팅후 실행이다.
yum이나 apt등 package manager로 설치하는 경우 기본적인 config 파일이 존재하는데 빌드해서 설치하면 config 파일이 전혀 없어 하나씩 구성해야 한다.


'준슝 > homelab' 카테고리의 다른 글

raspberry pi4 에서 php build 하기  (0) 2020.03.22

+ Recent posts