Google Domain에 DDClient로 유동 IP 연결하기

Installation DDclient for non-static ip address to connect google domain services #feat Raspberry Pi 4

1. Google Domain(https://domains.google.com) 접속 후 관리할 도메인 선택

Select the domain to manage after accessing Google Domain (https://domains.google.com).


2. DNS 관리 메뉴에서 동적 DNS(Dynamic DNS) 클릭

Click on Dynamic DNS in the DNS management menu.


3. 동적 DDNS 추가 및 사용자 정보 확인

새 레코드 만들기를 클릭 후 , 생성할 2차 도메인 주소를 호스트 이름에 기재하고, 저장한다.

Click on ‘Create a new record’ and enter the host name with the 2nd level domain address to be created. Then save it.

보기를 누르면 Google Domain에서 생성한 아이디 및 비밀번호를 확인할 수 있으며, 복사할 수 있다. 따로 적어두던지, 창을 닫지 말고 열어두자. 서버에 데몬 설치할 때 필요하다.

By clicking on ‘view’, you can confirm the ID and password created by Google Domain, and you can copy it. Write it down or keep the window open, as it will be needed when installing the daemon on the server.


4. 쉘 접속(SSH) 후 DDclient 설치

After connecting to the shell (SSH), install DDclient

sudo apt-get update 
sudo apt-get install ddclient

5. DDclient 설정(/etc/ddclient.conf)

Configure DDclient (/etc/ddclient.conf)

sudo vi /etc/ddclient.conf

login 및 password 부분에는 Google 로그인 정보가 아닌, google domains에서 발급한 해당 domain DDNS의 id 및 password를 입력해야 합니다.

In the login and password section, you need to enter the ID and password of the corresponding domain DDNS issued by Google domains, not the Google login information

설치 과정 중에 아래 ddclient.conf에 기록될 내용을 물어보면서 진행이 됩니다.

수정할 내용이 없으면 따로 conf 파일을 열어보지 않아도 동작에는 문제가 없습니다.

If you are asked about the contents that will be recorded in ddclient.conf during the installation process, the process will proceed. If there is no content to be modified, there will be no problems in operation even if you do not open the conf file separately.

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
protocol=googledomains  #old version: dyndns2
use=web, web=https://domains.google.com/checkip 
login=login id here 
password='login password here' 
blog.illuwa.net #domain

6. DDclient 데몬 설정

DDclient daemon (background service) can be set up by following these steps:

sudo vi /etc/default/ddclient
# Configuration for ddclient scripts
# generated from debconf on 2022. 08. 29. (월) 13:46:21 KST
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time DHCP client ('dhclient'
# from package isc-dhcp-client) updates the systems IP address.
run_dhclient="true"
# Set to "true" if ddclient should be run every time a new ppp connection is
# established. This might be useful, if you are using dial-on-demand.
run_ipup="false"
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval="5m"\

7. ddclient 서비스 자동 시작 등록 및 상태 확인

Register ddclient service for automatic start and check its status

sudo systemctl enable ddclient
sudo systemctl start ddclient
sudo systemctl status ddclient
ddclient.service - Update dynamic domain name service entries
     Loaded: loaded (/lib/systemd/system/ddclient.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-08-29 13:46:23 KST; 1h 37min ago
       Docs: man:ddclient(8)
   Main PID: 256871 (ddclient - slee)
      Tasks: 1 (limit: 4164)
        CPU: 1.217s
     CGroup: /system.slice/ddclient.service
             └─256871 ddclient - sleeping for 170 seconds
 8월 29 13:46:23 raspberrypi systemd[1]: Starting Update dynamic domain name service entries...
 8월 29 13:46:23 raspberrypi systemd[1]: Started Update dynamic domain name service entries.

8. 업데이트 되는지 Google Domain에서 확인

Check if updated in Google Domains


9. 정 안되면, URL로 직접하자.

If it is not working, let’s directly try it through the URL.

설치가 어려운 경우, 브라우저나 콘솔로 아래 URL로 접속하면 구글에 업데이트 할 수 있다. (굵은 글씨 수정)

In case the installation is difficult, you can update Google by accessing the URL below using a browser or console.

https://username:password@domains.google.com/nic/update?hostname=sub.mydomain.com&myip=1.2.3.4

구글 도메인 레퍼런스 링크(google domain reference link)

One Reply to “Google Domain에 DDClient로 유동 IP 연결하기”

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

*