티스토리에 개인 도메인을 적용하려면 blog.tistory.com 을 CNAME 으로 설정을 하여야 합니다.

$TTL    3600
@       IN      SOA     ns.example.kr.    root (
                                        2019041510      ; serial
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expire
                                        1D )            ; minimum
        IN      NS              ns.example.kr.
        IN      MX      10      mail.example.kr.
        IN      A               192.168.1.2
ns      IN      A               192.168.1.2
mail    IN      A               192.168.1.2
www     IN      A               192.168.1.2
blog    IN      CNAME           blog.tistory.com.

뒷쪽에 점(.) 을 꼭찍어야 합니다.

 

블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

Let's Encrypt 로 무료 인증서를 발급 받을려고 했더니 "DNS problem: SERVFAIL looking up CAA for ..." 에러 메시지가 뜨면서 더 이상 진행이 안되네요~

직접 네임서버 운영으로 해결했습니다.

# certbot certonly --standalone --agree-tos -m email@address -d www.example.kr
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for www.example.kr
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.example.kr (http-01): urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up CAA for www.ivps.kr

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: www.example.kr
   Type:   None
   Detail: DNS problem: SERVFAIL looking up CAA for www.example.kr

CAA 레코드를 지정하고 난 뒤에 인증서 발급이 되네요~

 

www.example.kr.        CAA 0   issue   "letsencrypt.org"

/var/named/example.kr.zone 파일에 위의 필드를 추가하고 named 재시작 하고 인증서 발급해보세요~

 

블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

CentOS 7.x BIND 네임서버(DNS) 설치 및 설정하기



네임서버 설치 및 설정 그리고 named-checkconf 와 named-checkzone 으로 제대로 설정이 되었는지 검증에 대해서 알아보자.


# yum -y install bind bind-libs bind-utils bind-chroot


/etc/named.conf (options 부분 수정)

options {

        version "Unknown";

        allow-transfer { none; };

        allow-recursion { localhost; };

        allow-query-cache { localhost; };

        //listen-on port 53 { 127.0.0.1; };

        listen-on port 53 { any; };

        //listen-on-v6 port 53 { ::1; };

        directory       "/var/named";

        dump-file       "/var/named/data/cache_dump.db";

        statistics-file "/var/named/data/named_stats.txt";

        memstatistics-file "/var/named/data/named_mem_stats.txt";

        //allow-query     { localhost; };

        allow-query     { any; };


        /*

         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.

         - If you are building a RECURSIVE (caching) DNS server, you need to enable

           recursion.

         - If your recursive DNS server has a public IP address, you MUST enable access

           control to limit queries to your legitimate users. Failing to do so will

           cause your server to become part of large scale DNS amplification

           attacks. Implementing BCP38 within your network would greatly

           reduce such attack surface

        */

        recursion yes;


        dnssec-enable yes;

        dnssec-validation yes;


        /* Path to ISC DLV key */

        bindkeys-file "/etc/named.iscdlv.key";


        managed-keys-directory "/var/named/dynamic";


        pid-file "/run/named/named.pid";

        session-keyfile "/run/named/session.key";

};


옵션 설정은 여기까지 완료되었다. ( allow-recursion, allow-query-cache 에 any 를 설정하면 타 dns까지 쿼리가 가능해진다. )


named 서비스를 동작시켜보자.


[root@conoha ~]# systemctl start named

[root@conoha ~]# systemctl enable named

Created symlink from /etc/systemd/system/multi-user.target.wants/named.service to /usr/lib/systemd/system/named.service.


에러가 없다면 다음으로 넘어가자.


zone 파일을 연결시켜주자.


아래와 같이 실행하여 /etc/named.rfc1912.zones 에 추가할 수도 있고 직접 추가해주어도 된다.


cat >>/etc/named.rfc1912.zones<<EOF

zone "example.com" IN {

        type master;

        file "example.com.zone";

        allow-update { none; };

};


EOF


example.com 대신에 자신의 도메인 주소에 맞게 설정하여야 한다.


zone 파일을 생성해주자.


# vi /var/named/example.com.zone


$TTL 3H

@       IN      SOA     ns.example.com. root (

                                        160509  ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

        IN      NS      ns.example.com.

        IN      A       123.123.123.123

ns      IN      A       123.123.123.123

www     IN      A       123.123.123.123


소유권을 변경해주자.


# chown root.named /var/named/example.com.zone


이번엔 제대로 되었는지 검증을 해볼 차례다.


named-checkconf 확인


[root@conoha ~]# named-checkconf -z /etc/named.conf

zone localhost.localdomain/IN: loaded serial 0

zone localhost/IN: loaded serial 0

zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0

zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0

zone 0.in-addr.arpa/IN: loaded serial 0

zone example.com/IN: loaded serial 160509


named-checkzone 확인



[root@conoha named]# named-checkzone ns.example.com /var/named/example.com.zone   zone ns.example.com/IN: loaded serial 160509

OK

[root@conoha named]# named-checkzone www.example.com /var/named/example.com.zone

zone www.example.com/IN: loaded serial 160509

OK


이상이 없다면


# systemctl restart named


그리고 방화벽에서 53 포트를 열어주어야 한다.


# firewall-cmd --permanent --zone=public --add-service=dns

# firewall-cmd --reload



블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,