DNS 설정 점검
    • PDF

    DNS 설정 점검

    • PDF

    Article Summary

    Classic 환경에서 이용 가능합니다.

    네이버 클라우드 플랫폼에서 제공하는 DNS 설정을 사용하지 않으면, 내부 관리를 위해서 제공되는 서버와 정상적인 통신이 불가할 수 있습니다. 가급적이면 DNS를 별도로 설정하지 마십시오. 별도로 DNS를 설정할 경우 서버 이미지로 서버를 생성하거나 관리자 비밀번호를 설정하는 과정 등에서 오류가 발생할 수 있습니다.

    CentOS

    네이버 클라우드 플랫폼에서 제공 중인 RedHat 계열의 OS에서 DNS 설정값 및 파일을 점검해 주십시오.

    참고

    CentOS 7.2, CentOS 7.3, CentOS 7.8을 대상으로 설명합니다.

    1. DHCP에서 받아온 네이버 클라우드 플랫폼 DNS 설정값을 확인해 주십시오. Classic 환경에서 제공되는 DNS 서버의 IP는 10.250.255.1110.250.255.12입니다.
      [root@centos78 ~]# grep domain-name /var/lib/dhclient/dhclient--eth0.lease
        option domain-name-servers 10.250.255.11,10.250.255.12;
        option domain-name "ncloud.com";
        option domain-name-servers 10.250.255.11,10.250.255.12;
        option domain-name "ncloud.com";
      
    2. /etc/resolv.conf 파일 설정 및 내용을 확인해 주십시오.
      • 파일의 내용이 다음 정보와 다를 경우 네이버 클라우드 플랫폼 DNS 서버와 정상적인 통신이 불가할 수 있습니다. 단, 파일을 수정한 후 OS를 재부팅하면 DHCP에서 받아온 네이버 클라우드 플랫폼 설정값으로 초기화됩니다.
      [root@centos78 ~]# cat /etc/resolv.conf
      ; generated by /usr/sbin/dhclient-script
      search ncloud.com
      nameserver 10.250.255.11
      nameserver 10.250.255.12
      
    3. nslookup 명령을 실행해 DNS 쿼리 동작을 확인해 주십시오.
      • 정상적으로 쿼리가 동작할 경우 10.250.5.105가 출력됩니다.
      [root@centos78 ~]# nslookup repo.ncloud.com
      Server:		10.250.255.11
      Address:	10.250.255.11#53
      
      Non-authoritative answer:
      repo.ncloud.com	canonical name = repo.ncloud.grm.ncloud.com.
      repo.ncloud.grm.ncloud.com	canonical name = kr2-init.ncloud.grm.ncloud.com.
      Name:	kr2-init.ncloud.grm.ncloud.com
      Address: 10.250.5.105
      

    Ubuntu

    네이버 클라우드 플랫폼에서 제공 중인 Ubuntu 18.04는 systemd-resolved를 사용합니다. Ubuntu 계열의 OS에서 DNS 설정값 및 파일을 점검해 주십시오.

    참고

    Ubuntu 18.04를 대상으로 설명합니다.

    1. /etc/resolv.conf 파일 설정 및 내용을 확인해 주십시오.
      • 파일의 Symbolic Link 여부를 확인해 주십시오.
      root@ubuntu1804:~# ll /etc/resolv.conf
      lrwxrwxrwx 1 root root 39 Sep 28  2020 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
      
    2. 파일의 내용이 다음 정보와 동일한지 확인해 주십시오.
      root@ubuntu1804:~# cat /etc/resolv.conf
      # This file is managed by man:systemd-resolved(8). Do not edit.
      ... 생략 ...
      nameserver 127.0.0.53
      options edns0
      search ncloud.com
      
    3. DHCP에서 받아온 네이버 클라우드 플랫폼 DNS 설정값을 확인해 주십시오.
      root@ubuntu1804:~# cat /run/systemd/resolved.conf.d/isc-dhcp-v4-eth0.conf
      [Resolve]
      DNS=10.250.255.11 10.250.255.12
      Domains= ncloud.com
      
    4. OS에서 설정된 DNS 설정값을 확인해 주십시오. Classic 환경에서 제공되는 DNS 서버의 IP는 10.250.255.1110.250.255.12입니다.
      root@ubuntu1804:~# cat /run/systemd/resolve/resolv.conf
      ... 생략 ...
      nameserver 10.250.255.11
      nameserver 10.250.255.12
      search ncloud.com
      
      • 만약 다음과 동일하게 보이면 DNS 서버 설정이 비정상적인 상태입니다.
        root@ubuntu1804:~# tail -2 /run/systemd/resolve/resolv.conf
        
        # No DNS servers known.
        
      • 해당되는 경우 다음과 같이 처리 가능합니다.
        root@ubuntu1804:~# cat /run/systemd/resolved.conf.d/isc-dhcp-v4-eth0.conf
        [Resolve]
        DNS=10.250.255.11 10.250.255.12
        Domains= ncloud.com
        
        root@ubuntu1804:~# systemctl restart systemd-resolved
        root@ubuntu18:~# tail -3 /run/systemd/resolve/resolv.conf
        nameserver 10.250.255.11
        nameserver 10.250.255.12
        search ncloud.com
        
    5. systemd-resolved 데몬의 기동 여부 및 상태를 확인해 주십시오.
      • 설치된 unit 목록에서 systemd-resolved 데몬이 enabled 상태여야 부팅 후에도 정상 동작 가능합니다.
        root@ubuntu1804:~# systemctl list-unit-files | grep systemd-resolved.service
        systemd-resolved.service               enabled
        
      • systemd-resolved 데몬이 active 상태여야 정상 동작이 가능합니다.
        root@ubuntu1804:~# systemctl status systemd-resolved.service
        ● systemd-resolved.service - Network Name Resolution
           Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
           Active: active (running) since Sun 2023-04-09 20:27:10 KST; 14h ago
             Docs: man:systemd-resolved.service(8)
                   https://www.freedesktop.org/wiki/Software/systemd/resolved
                   https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
                   https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
         Main PID: 687 (systemd-resolve)
           Status: "Processing requests..."
            Tasks: 1 (limit: 4622)
           CGroup: /system.slice/systemd-resolved.service
                   └─687 /lib/systemd/systemd-resolved
        
      • IP 주소 127.0.0.53의 연결 상태를 확인해 주십시오. systemd-resolve 서비스에 의해 53(nameservice port) 포트를 통해 LISTEN 중이어야 합니다.
        root@ubuntu1804:~# netstat -anp | grep 127.0.0.53
        tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      687/systemd-resolve 
        udp        0      0 127.0.0.53:53           0.0.0.0:*                           687/systemd-resolve
        
    6. systemd-resolve 서비스에서 DNS 설정값을 확인해 주십시오.
      • 다음의 명령어로 쿼리를 날리는 DNS 서버 정보를 확인해 주십시오.
        root@ubuntu1804:~# systemd-resolve --status
        Global
             DNS Servers: 10.250.255.11
                          10.250.255.12
         ... 생략 ...
        
    7. /etc/hosts 파일의 권한을 확인해 주십시오.
      • /etc/hosts 파일의 Other User에 read 권한을 부여해야 systemd-resolved 데몬이 정상적으로 동작합니다. 기본 설정으로 /etc/hosts 파일의 권한은 644로 되어 있습니다.
      root@ubuntu1804:~# ls -l /etc/hosts
      -rw-r--r-- 1 root root 189 Sep 28  2020 /etc/hosts
      
    8. nslookup 명령을 실행해 DNS 쿼리 동작을 확인해 주십시오.
      • 정상적으로 쿼리가 동작할 경우 10.250.5.105가 출력됩니다.
      root@ubuntu1804:~# nslookup repo.ncloud.com
      Server:		127.0.0.53
      Address:	127.0.0.53#53
      
      Non-authoritative answer:
      repo.ncloud.com	canonical name = repo.ncloud.grm.ncloud.com.
      repo.ncloud.grm.ncloud.com	canonical name = kr2-init.ncloud.grm.ncloud.com.
      Name:	kr2-init.ncloud.grm.ncloud.com
      Address: 10.250.5.105
      

    Fade-out DNS 서버 변경

    확인된 DNS 서버 설정값이 125.209.192.12 또는 125.209.192.13이면, DNS 서버 변경이 필요합니다.
    변경 대상이 맞는지 먼저 점검한 후, 대상이 맞을 경우 DNS 서버 변경을 진행해 주십시오.

    Linux

    주의

    해당 가이드 대상 장비는 Classic 일부 VM만 해당됩니다. 변경 대상이 아닌 경우 해당 작업을 실행하지 마십시오.

    1. DNS 서버 설정 변경 파일을 실행하여 resolv.conf 설정의 DNS 서버를 변경해 주십시오.
      [root@centos78 ~]# curl -sSL -k https://kr.object.ncloudstorage.com/dns-tools/resolv-change.sh | /bin/bash
      
      • 파일 실행 시 자동으로 DNS 서버가 변경되고 질의가 정상적으로 이루어지는지 테스트가 진행됩니다.
        437E3170-9B18-4740-8905-05D9CBDF3182.jpg
    주의

    125.209.192.12, 125.209.192.13 이외의 DNS 서버는 해당 작업으로 변경되지 않습니다.

    참고

    DNS 서버가 정상적으로 변경되지 않으면 다음과 같이 작업 결과가 변경 실패로 표시됩니다. 해당되는 경우 고객 지원으로 문의해 주십시오.

    [root@centos78 ~]# curl -sSL -k https://kr.object.ncloudstorage.com/dns-tools/resolv-change.sh | /bin/bash
    
    작업 결과 (Task Result): 변경 실패 (Change failed)
    Failed to change resolv.conf settings. The required nameserver(s) not found.
    

    Windows

    Windows 서버에서 DNS 설정 방법은 다음과 같습니다.

    1. Windows 서버에 접속해 주십시오.
    2. i-server_window_start을 클릭한 후 Settings > Network & Internet > Change adapter options 메뉴를 차례대로 클릭해 주십시오.
      • 실행 창에 ncpa.cpl를 입력할 수도 있습니다.
    3. 표시되는 목록에서 사용하시는 네트워크를 찾아 마우스 오른쪽 클릭한 후 Properties을 클릭해 주십시오.
      • Internet Protocol Version 4 (TCP/IPv4) Properties에서 하단 Use the following DNS server addresses를 10.250.255.11, 10.250.255.12으로 수정해 주십시오.
    주의

    Active Directory, DNS Server 등 자체 DNS를 운영하시는 경우 확인 후 필요에 따라 변경해 주십시오.

    DNS 관련 자주하는 질문

    Q. DNS 질의 시 아래와 같이 isc_socket_bind 에러가 발생합니다. 어떻게 조치를 해야 하나요?

    [root@ncp-server ~]# nslookup repo.ncloud.com
    Server:		10.250.255.11
    Address:	10.250.255.11#53
    
    Non-authoritative answer:
    repo.ncloud.com	canonical name = repo.ncloud.grm.ncloud.com.
    repo.ncloud.grm.ncloud.com	canonical name = kr2-init.ncloud.grm.ncloud.com.
    Name:	kr2-init.ncloud.grm.ncloud.com
    Address: 10.250.5.105
    nslookup: isc_socket_bind: address in use
    

    해당 이슈는 고객 서비스 네트워크 환경에 비해 ip_local_port_range 값이 너무 작거나, 현재 사용 중인 socket port가 과도하게 많은 경우에 발생합니다.
    ip_local_port_range는 아래와 같이 확인이 가능합니다. 기본값으로는 최소 포트 32768, 최대 포트 60999로 설정되어 있습니다.

    [root@ncp-server ~]# sysctl net.ipv4.ip_local_port_range
    net.ipv4.ip_local_port_range = 32768    60999
    

    리부팅 가능한 서버일 경우에는, 운영체제에서 리부팅을 하시고 불가능한 경우에는 현재 사용 중인 소켓 개수를 확인하여 불필요한 소켓을 정리하거나 ip_local_port_range 값을 늘리는 것을 권장 드립니다.
    정상 상태에서 DNS 질의할 경우에는 아래와 같이 출력되는 것을 확인할 수 있습니다.

    [root@ncp-server ~]# nslookup repo.ncloud.com
    Server:		10.250.255.11
    Address:	10.250.255.11#53
    
    Non-authoritative answer:
    repo.ncloud.com	canonical name = repo.ncloud.grm.ncloud.com.
    repo.ncloud.grm.ncloud.com	canonical name = kr1-init.ncloud.grm.ncloud.com.
    Name:	kr1-init.ncloud.grm.ncloud.com
    Address: 10.101.86.18
    

    이 문서가 도움이 되었습니까?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.