Ubuntu Server에서 동적 DNS 가져 오기 서비스를 설정하려면 어떻게해야합니까?


19

http://no-ip.org/ 계정 내에서 계정과 호스트 이름을 만들었습니다. 내 계정 유형에 가장 많이 사용되는 서비스입니다. 커맨드 라인 멍청한 놈으로 누군가 ddclient를 no-ip와 함께 사용하는 구성 프로세스를 안내 할 수 있습니까?

답변:


21

No-IP를위한 ddclient 설정

ddclient동적 DNS 항목을 업데이트하는 데 사용할 수있는 DIC (Dynamic Update Client)입니다. 정기적으로 현재 IP 주소를 확인하고 변경이 감지되면 DNS 정보를 업데이트합니다. No-IP (noip.com/no-ip.com) 서비스를 위해 설치 및 구성하는 방법은 다음과 같습니다.

먼저 ddclient패키지를 설치하십시오 . 나중에 수동으로 구성하므로 모든 구성 질문에 대해서는 Enter 키를 누르십시오.

sudo apt-get install ddclient

ddclient데몬을 중지하십시오 . sudo service ddclient stop우리가 사용하는, 그래서 명령은 버그로 인해 우분투 12.04에서 작동하지 않습니다 pkill대신.

sudo pkill ddclient

구성 파일을 편집하십시오. 백업 파일을 해제하려면 (예를 들어 /etc/ddclient.conf~) 어느 gedit기본적으로 생성하고, 예를 들어 당신이 당신이 그들을 삭제했다고 생각 후, 암호가 들어있는 설정을 해제 할 수있는 Edit -> Preferences -> Editor -> Create a backup copy of files before saving.

sudo gedit /etc/ddclient.conf /etc/default/ddclient

이전에 /etc/ddclient.conf표시된 내용을 삭제하고 아래 표시된 템플릿에 붙여 넣습니다.

템플릿의 설명을 읽고 필요에 따라 파일을 사용자 정의하십시오.

noip.com 하위 계정, 즉 비밀번호가있는 그룹 (이 기능은 유료 서비스)을 사용하는 것이 좋습니다. 이 방법으로 암호는 지정된 호스트 만 업데이트하고 전체 No-IP 계정에 대한 전체 액세스 권한은 제공하지 않습니다. 여기에는 MX 레코드가 포함될 수 있습니다 (암호를 획득 한 공격자는 전자 메일을 가로 채기 위해 MX 레코드를 변경할 수 있음) ) 또는 IMAP 계정과 같은 기타 서비스

아마도 설정해야합니다 daemon_interval=3600(템플릿 주석 참조).

다음 명령으로 구성을 테스트하십시오.

sudo ddclient -daemon=0 -debug -verbose -noquiet -force

good(IP 주소 업데이트) 또는 nochg(IP 주소가 이미 해당 값으로 설정되어 있음) 응답을 받아야합니다 . 이 시점에서 다음과 같은 경고를받는 것은 괜찮습니다 (그러나 정상 작동 중에 경고가 계속 표시되는 것은 아닙니다) :

WARNING: updating <hostname>: nochg: No update required; unnecessary attempts to change to the current address are considered abusive

참고 : No-IP 서버에서 일부 캐싱이 진행되고있는 것 같습니다. 따라서 서버에서 수신 한 응답이 예상과 다른 경우 잠시 기다리면 도움이 될 수 있습니다.

구성이 완료되면 ddclient데몬을 시작하십시오 .

sudo service ddclient start

컴퓨터를 시작할 때마다 데몬도 자동으로 시작됩니다.

이제 IP 주소 변경이 감지 될 때마다 DNS 항목 / 항목이 업데이트됩니다.

문제 해결

패키지 구성을 다시 실행하십시오.

sudo dpkg-reconfigure ddclient

패키지 및 구성 파일을 제거하십시오.

sudo apt-get purge ddclient

데몬 제어 :

sudo service ddclient status
sudo service ddclient start
sudo service ddclient stop
# The stop command above does not work on Ubuntu 12.04 due to a bug, but
# it works on 14.04. Here are alternative ways to control the daemon:
ps -A f | grep -i ddclient
sudo pkill ddclient

캐시를 삭제하여 디버깅 목적으로 데몬이 DNS 항목을 업데이트하도록 속입니다 (정상 작동 중에 DNS 항목은 현재 IP 주소가 캐시에 저장된 IP 주소와 다른 경우에만 업데이트 됨).

sudo pkill ddclient
sudo rm /var/cache/ddclient/ddclient.cache
sudo service ddclient start
# See the result:
tail /var/log/syslog
# If you have set up mail=..., you should also receive an e-mail.
# The syslog and e-mail should show a "good" or "nochg" response.

DNS 항목 IP 주소를 1.2.3.4로 설정 한 다음 데몬을 시작하여 IP 주소가 변경되었을 때 디먼이 실제로 DNS 항목을 업데이트하는지 테스트하십시오.

sudo pkill ddclient
sudo ddclient -daemon=0 -debug -verbose -noquiet -force -use ip -ip 1.2.3.4
sleep 30   # ddclient will not perform updates less than 30 seconds apart
sudo service ddclient start

디버그 실행 (DNS 항목 업데이트 안 함 / 필요 / 항상) :

sudo ddclient -daemon=0 -debug -verbose -noquiet -noexec
sudo ddclient -daemon=0 -debug -verbose -noquiet
sudo ddclient -daemon=0 -debug -verbose -noquiet -force

다양한 방법으로 현재 IP 주소를 감지하십시오.

sudo ddclient -query

관심있는 파일 :

/etc/ddclient.conf
/etc/default/ddclient
/var/cache/ddclient/ddclient.cache

데몬의 메시지가 여기에 표시됩니다 (설정된 경우 이메일로도 전송 됨).

/var/log/syslog

선적 서류 비치:

/etc/ddclient.conf의 템플릿

################################################################################
# Configuration file for ddclient
################################################################################


################################################################################
# Misc. configurations

# To choose between ipup mode (for dial-on-demand) and daemon mode, please edit
# /etc/default/ddclient.

#mail=root           # E-mail messages to this address
#mail-failure=root   # E-mail messages about failed updates to this address


################################################################################
# How to obtain current IP address

# Methods:
#   use=ip, ip=ADDRESS                                   # Set the IP address to ADDRESS
#   use=if, if=INTERFACE, if-skip=PATTERN                # Obtain IP address by calling 'ifconfig INTERFACE'
#   use=web, web=PROVIDER|URL, web-skip=PATTERN          # Obtain IP address from IP discovery web page
#   use=cmd, cmd=PROGRAM, cmd-skip=PATTERN               # Obtain IP address by calling PROGRAM
#   use=fw|FWMODEL, fw=ADDRESS|URL, fw-skip=PATTERN      # Obtain IP address from firewall web page
#                   fw-login=LOGIN, fw-password=SECRET
#
# The *-skip options can be used to skip IP addresses found before PATTERN.
#
# NOTE: The ddclient IP detection routines do not respect the HTTPS prefix in
# URLs, and instead fall back to HTTP (this is fixed in version 3.8.1). The
# option ssl=yes does not apply to the IP detection either (this is at least
# how versions 3.8.0 to 3.8.2 behave).
#
# The default time between each IP address change check is daemon_interval=300
# (5 minutes), which may be a bit too frequent when using an external IP
# discovery service. To set the checking interval to e.g. one hour instead,
# please edit /etc/default/ddclient and set daemon_interval=3600.

# Obtain IP address from network interface
#use=if, if=eth0

# Obtain IP address from no-ip.com IP discovery web page (unencrypted connection)
use=web, web='http://ip1.dynupdate.no-ip.com:8245/'

# Obtain IP address from no-ip.com IP discovery web page (encrypted connection)
# Encryption does not offer any real protection since a man-in-the-middle
# attack could route the HTTPS connection through a host belonging to the
# attacker, thus causing an incorrect IP address to be reported.
#use=cmd, cmd='bash -c "set -o pipefail; timeout 120 wget -qO- \
#  --header=Host:ip1.dynupdate.no-ip.com https://dynupdate.no-ip.com/ | head -c 1000"'


################################################################################
# Dynamic DNS service setup

protocol=noip
#server=   # Defaults to dynupdate.no-ip.com for noip protocol
ssl=yes   # NOTE: Does not apply when obtaining IP address, just when updating the DNS entry!
login='nobody@nowhere.com'   # Username. For No-IP sub-accounts (groups with passwords), use '<groupname>%3A<username>'.
password='1234'


################################################################################
# Hosts to update, with optional per-host options

# Examples:
#   protocol=hammernode1, \
#   login='my-hn-login', password='my-hn-password' \
#   myhost.hn.org,myhost2.hn.org
#
#   login='group2%3Ajohndoe@domain.com', password='1234'   myhost3.no-ip.biz,myhost4.no-ip.biz
#
#   myhost.no-ip.biz,myhost2.no-ip.biz

my.full.hostname

업데이트 : IP 감지 서비스에 대한 암호화 된 연결은 의미가 없습니다. 이것은 ddclient.conf 템플릿에 설명되어 있으며 IP 탐지를 위해 암호화되지 않은 연결을 사용하도록 기본 설정되어 있습니다.



0

No-ip에는 처음 설치했을 때 저를 위해 일한 자체 클라이언트가 있습니다.

자체 웹 사이트에 클라이언트 다운로드 지침 이 있으며 빠른 make && make설치가 완료되었습니다. 구성 마법사의 일부로 물어볼 수 있으므로 no-ip에 대한 로그인 자격 증명을 보유하십시오. 그 후, 당신이 실행 noip2하고 있는지 확인 하고 자신의 사이트에서 호스트 계정이 업데이트되었는지 확인하십시오.


경고 : noip2에 보안 문제가 있습니다! 이 답변을 참조하십시오 .
Håkon A. Hjortland

@ HåkonA.Hjortland : HTTPS 연결을 허용한다는 것을 몰랐습니다. 이전의 잘못된 진술을 삭제했습니다. 감사합니다.
MestreLion
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.