Files
ettore.dreucci.it/public/blog/ispconfig-ddns/index.html
2019-05-24 23:14:20 +02:00

1321 lines
32 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="GNU/Linux Nerd">
<meta property="og:site_name" content="Ettore Dreucci" />
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://ettore.dreucci.it/blog/ispconfig-ddns/" />
<meta property="og:title" content="ISPConfig Dynamic DNS" />
<meta property="twitter:title" content="ISPConfig Dynamic DNS">
<meta property="og:image" content="https://ettore.dreucci.it/img/banner.png">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:image" content="https://ettore.dreucci.it/img/banner.png">
<meta property="og:description" content="How to create and update a DDNS entry in ISPConfig">
<meta property="twitter:description" content="How to create and update a DDNS entry in ISPConfig">
<title>
Ettore Dreucci - ISPConfig Dynamic DNS
</title>
<link rel="canonical" href="https://ettore.dreucci.it/blog/ispconfig-ddns/">
<style media="screen">
@font-face {
font-family: 'Nexa Bold';
src: url('https://ettore.dreucci.it/fonts/Nexa Bold.otf');
}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, div.column {
display: block;
}
figcaption {
text-align: center;
}
figcaption h4 {
margin-top: 0rem !important;
font-size: 0.85rem !important;
font-weight: 600 !important;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
a,
a:visited,
a:focus,
a:active {
text-decoration: none;
}
html {
height: 100%;
font-size: 16px;
}
body {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
justify-content: flex-start;
width: 100%;
min-height: 100%;
font-weight: 400;
font-family: 'Helvetica Neue', 'Arial', sans-serif;
color: #111111;
line-height: 1.6;
text-rendering: optimizeLegibility !important;
}
.icon {
text-rendering: geometricPrecision !important;
}
section {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
width: 100%;
}
div.column {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
width: 100%;
}
.container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
width: 100%;
}
div.header .container {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
}
div.header .content {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
}
div.header .container .logo {
max-width: 100px;
margin-left: -2em;
}
div.header .name {
padding-top: 20px;
font-size: 28px;
font-family: 'Nexa Bold', 'Helvetica Neue', 'Arial', sans-serif;
letter-spacing: -0.005rem;
text-transform: uppercase;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
color: #333333;
}
div.header nav {
margin-bottom: 16px;
}
div.header nav ul {
list-style: none;
text-align: center;
display: -webkit-inline-flex;
display: -moz-inline-flex;
display: -ms-inline-flexbox;
display: -ms-inline-flex;
display: inline-flex;
}
div.header nav ul li {
margin-left: 6px;
margin-right: 6px;
}
div.header nav ul li:first-child {
margin-left: 0;
}
div.header nav ul li:last-child {
margin-right: 0;
}
div.header nav ul a {
color: #555555;
font-weight: 400;
font-size: 14px;
text-transform: uppercase;
font-family: 'Helvetica Neue', 'Arial', sans-serif;
-webkit-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-moz-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-ms-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-o-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
div.header nav ul a:hover {
color: #111111;
}
div.footer .container {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
flex-direction: column-reverse;
width: 100%;
text-align: center;
}
div.footer .container a {
font-size: 14px;
margin-left: 6px;
margin-right: 6px;
opacity: 0.6;
-webkit-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-moz-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-ms-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-o-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
div.footer .container a:first-child {
margin-left: 0;
}
div.footer .container a:last-child {
margin-right: 0;
}
div.footer .container a:hover {
opacity: 0.8;
}
div.footer .container a .icon {
width: 16px;
height: 16px;
}
div.footer .container .copyright {
flex-grow: 0.5;
text-align: start;
}
div.footer .container .icons {
flex-grow: 0.5;
text-align: end;
}
div.main .container {
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
justify-content: flex-start;
}
div.main .content {
color: #111111;
font-size: 16px;
}
div.main .content .title-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
justify-content: space-between;
}
div.main .content .posts {
}
div.main .content .page-heading {
font-size: 20px;
font-weight: 700;
font-family: 'Helvetica Neue', 'Arial', sans-serif;
letter-spacing: -0.005rem;
text-transform: uppercase;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
color: #333333;
margin-bottom: 16px;
}
div.main .content .front-matter .page-heading {
margin-bottom: 0;
}
div.main .content .front-matter .meta {
font-size: 14px;
color: #666666;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
margin-bottom: 32px;
}
div.main .content .front-matter .desc {
display: block;
}
div.main .content .front-matter .date,
div.main .content .front-matter .author,
div.main .content .front-matter .tags,
div.main .content .front-matter .word-count,
div.main .content .front-matter .middot:before {
display: none;
}
div.main .content .front-matter .middot:before {
font-size: 6px;
margin: 0 6px;
vertical-align: middle;
content: "•";
}
div.main .content .front-matter .tags ul {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
}
div.main .content .front-matter .tags ul li {
-webkit-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-moz-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-ms-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-o-transition: opacity 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
div.main .content .front-matter .tags ul li:hover {
opacity: 0.7;
}
div.main .content .front-matter .tags ul li a {
color: #666666;
}
div.main .container.f04 {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
}
div.main .container.f04 .content {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
}
div.main .container.f04 .content .num {
margin: 30px 0px 30px 0;
font-weight: 400;
font-family: 'Helvetica Neue', 'Arial', sans-serif;
font-size: 50px;
}
div.main .container.f04 .content .detail {
margin-bottom: 40px;
}
div.main .container .content .groupby {
margin-top: 1em;
padding-left: 0.5em;
}
div.main .container .content .post-item {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
display: list-item;
list-style: disc inside;
}
div.main .container .content .post-item .meta {
font-size: 14px;
color: #666666;
display: none;
min-width: 100px;
}
div.main .container .content .see-more {
font-style: italic;
float: right;
font-size: 0.9em;
margin-top: 2em;
color: #313537;
}
div.main .container .content .see-more:hover {
color: #666;
}
section {
padding: 0 16px;
}
div.column {
padding: 0 16px;
}
div.header {
padding-top: 10px;
}
div.header-home {
padding-top: 36px;
}
div.main {
padding-top: 32px;
}
div.main .container .content .post-item .meta {
display: block;
}
div.main .container .content .post-item {
display: flex;
list-style: none;
}
a {
color: #428bca;
-webkit-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-moz-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-ms-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
-o-transition: color 0.1s cubic-bezier(0.47, 0, 0.75, 0.72);
}
a:hover {
color: #2a6496;
}
img {
max-width: 100%;
}
div.main .content {
width: 100%;
}
div.main .content .markdown {
font-size: 1.1em;
line-height: 1.75em;
color: #313537;
font-family: serif;
font-weight: 300;
}
div.main .content .markdown h1,
div.main .content .markdown h2,
div.main .content .markdown h3,
div.main .content .markdown h4,
div.main .content .markdown h5,
div.main .content .markdown h6 {
font-size: 22px;
font-family: 'Helvetica Neue', 'Arial', sans-serif;
letter-spacing: -0.005rem;
font-weight: 700;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
color: #333333;
text-transform: none;
margin-top: 1.75rem;
}
div.main .content .markdown h1 {
font-size: 1.75rem;
margin-bottom: 2rem;
}
div.main .content .markdown h2 {
font-size: 1.5rem;
margin-bottom: 1.5rem;
}
div.main .content .markdown h3 {
font-size: 1em;
margin-bottom: 1rem;
}
div.main .content .markdown h4,
div.main .content .markdown h5,
div.main .content .markdown h6 {
font-size: 1rem;
margin-bottom: 1rem;
letter-spacing: none;
}
div.main .content .markdown code,
div.main .content .markdown pre {
font-family: 'Menlo', monospace;
font-size: 0.98rem;
background-color: #f7f7f7;
}
div.main .content .markdown code {
/* enclosed by single backtick (`) */
padding: .15em .5em;
border-radius: 2px;
}
div.main .content .markdown pre {
/* Hugo specific: consider using the 'highlight' shortcode */
display: block;
margin-top: 1rem;
margin-bottom: 2rem;
padding: 1rem;
line-height: 1.5em;
white-space: pre;
word-break: break-all;
word-wrap: break-word;
}
div.main .content .markdown pre code {
/* enclosed by 4 backticks (````) */
padding: 0;
font-size: 0.9rem;
}
div.main .content .markdown a code {
color: #428bca !important;
}
div.main .content .markdown a code:hover {
text-decoration: underline;
}
div.main .content .markdown p {
text-align: justify;
margin-top: 0;
margin-bottom: 1em;
}
div.main .content .markdown ul,
div.main .content .markdown ol,
div.main .content .markdown dl {
margin-top: 1rem;
margin-bottom: 2rem;
}
div.main .content .markdown dt {
font-weight: bold;
}
div.main .content .markdown dd {
margin-bottom: .5rem;
}
div.main .content .markdown ul {
list-style-type: disc;
list-style-position: outside;
margin-bottom: 1.25rem;
}
div.main .content .markdown ol {
list-style-type: decimal;
margin-bottom: 1.25rem;
}
div.main .content .markdown li {
margin-left: 2em;
}
div.main .content .markdown em {
font-style: italic;
}
div.main .content .markdown strong {
font-weight: 700;
}
div.main .content .markdown hr {
position: relative;
margin: 1.75rem 0;
border: 0;
border-top: 1px solid #808080;
border-top: 1px solid #999999;
}
div.main .content .markdown abbr {
font-size: 0.85rem;
font-weight: bold;
color: #666666;
text-transform: uppercase;
}
div.main .content .markdown abbr[title] {
cursor: help;
border-bottom: 1px dotted #808080;
}
div.main .content .markdown blockquote {
padding: .5rem 1rem;
margin: .8rem 0;
color: #7a7a7a;
border-left: .25rem solid #e5e5e5;
}
div.main .content .markdown blockquote p:last-child {
margin-bottom: 0;
}
div.main .content .markdown figure {
width: 100%;
background: #fff;
margin-bottom: 1em;
}
div.main .content .markdown figure img {
width: 100%;
height: auto;
max-width: 100%;
display: block;
position: static;
margin: auto;
}
div.main .content .markdown table {
margin-bottom: 1rem;
width: 100%;
border: 1px solid #e5e5e5;
border-collapse: collapse;
}
div.main .content .markdown td,
div.main .content .markdown th {
padding: .25rem .5rem;
border: 1px solid #e5e5e5;
}
div.main .content .markdown tbody tr:nth-child(odd) td,
div.main .content .markdown tbody tr:nth-child(odd) th {
background-color: #f7f7f7;
}
div.main .content .markdown .footnotes ol {
list-style-type: decimal;
margin-left: 16px;
}
div.main .content .markdown .footnotes li {
list-style-type: unset;
}
div.main .content .markdown .footnote-ref {
font-size: 0.7em;
}
div.main .content .navigation {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
padding: 2em;
}
div.main .content .navigation div {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
margin-top: 1em;
}
div.main .content .navigation .icon {
width: 16px;
height: 16px;
}
div.main .content .navigation a {
width: 250px;
margin: 0 1em;
text-align: center;
font-style: italic;
color: #313537;
}
div.main .content .share, div.main .content .share div {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
align-items: center;
justify-content: center;
}
div.main .content .share {
background-color: rgba(152, 152, 152, 0.07);
padding: 1em 0;
}
div.main .content .share a {
margin: 0 6px;
}
kbd {
padding: 0.1em 0.6em;
border: 1px solid #ccc;
font-size: 11px;
font-family: Arial,Helvetica,sans-serif;
background-color: #f7f7f7;
color: #333;
-moz-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
-webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
display: inline-block;
margin: 0 0.1em;
text-shadow: 0 1px 0 #fff;
line-height: 1.4;
white-space: nowrap;
}
/* Fonts */
.wf-raleway-n4-active body,
.wf-raleway-n4-active div.header nav ul a,
.wf-raleway-n7-active div.main .content .page-heading,
.wf-raleway-n2-active div.main .container.f04 .content .num,
.wf-raleway-n7-active div.main .content .markdown h1,
.wf-raleway-n7-active div.main .content .markdown h2,
.wf-raleway-n7-active div.main .content .markdown h3,
.wf-raleway-n7-active div.main .content .markdown h4,
.wf-raleway-n7-active div.main .content .markdown h5,
.wf-raleway-n7-active div.main .content .markdown h6 {
font-family: 'Raleway';
}
.wf-merriweather-n3-active div.main .content .markdown {
font-family: 'Merriweather';
}
.wf-ubuntu-mono-n4-active div.main .content .markdown code,
.wf-ubuntu-mono-n4-active div.main .content .markdown pre {
font-family: 'Ubuntu Mono';
}
</style>
<style media="(min-width: 600px)">
body {
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
justify-content: center;
}
.non-narrow.zero-top-spacing {
padding-top: 0 !important;
}
section {
padding: 0 16px;
margin-left: 100px;
margin-right: 100px;
max-width: 750px;
}
div.column {
padding: 0 16px;
max-width: 750px;
}
div.header {
background-color: transparent;
}
div.header .container {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
justify-content: flex-start;
}
div.header .container .logo {
margin: 0;
}
div.header-home .container .logo {
max-width: 216px;
margin-left: 24px;
}
div.header-home .name-home {
padding-top: 30px;
font-size: 40px;
}
div.header-home nav ul a {
font-size: 18px;
}
div.header .content {
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
align-items: flex-start;
}
div.header .name {
color: #333333;
}
div.header nav {
font-size: 14px;
margin-bottom: 0;
}
div.header nav ul {
text-align: left;
}
div.header nav ul a {
color: #666666;
}
div.header nav ul a:hover {
color: #333333;
}
div.footer {
background-color: transparent;
}
div.footer .container {
flex-direction: row;
}
div.footer .container a {
margin-left: 3px;
margin-right: 3px;
color: #666666;
}
div.footer .container a:hover {
color: #333333;
}
div.footer .container a .icon {
font-size: 18px;
}
div.footer .container a .icon.larger {
font-size: 20px;
}
div.main .content .front-matter .date,
div.main .content .front-matter .author,
div.main .content .front-matter .tags,
div.main .content .front-matter .word-count,
div.main .content .front-matter .middot:before {
display: initial;
}
div.main .container.f04 {
-webkit-justify-content: flex-start;
-moz-justify-content: flex-start;
-ms-justify-content: flex-start;
justify-content: flex-start;
}
div.main .container.f04 .content {
-webkit-align-items: flex-start;
-moz-align-items: flex-start;
-ms-align-items: flex-start;
align-items: flex-start;
}
div.main .container.f04 .content .num {
margin: 0 0 10px 0;
font-size: 32px;
}
div.main .container.f04 .content .detail {
margin-bottom: 30px;
}
.container {
padding: 0 30px;
}
div.header {
padding-top: 60px;
padding-bottom: 60px;
}
div.footer {
padding-top: 60px;
padding-bottom: 60px;
}
div.main {
padding-top: 0;
}
div.main .content {
font-size: 16px;
}
div.main .container .content .post-item {
display: flex;
list-style: none;
padding-left: 1.5em;
}
div.main .container .content .post-item .meta {
display: block;
}
div.main .content .markdown blockquote {
padding-right: 5rem;
padding-left: 1.25rem;
}
div.main .content .navigation {
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
div.main .content .navigation div {
margin-top: 0em;
}
</style>
<style media="(min-width: 769px)">
div.main .content .markdown figure {
width: 110%;
margin-left: -4%;
}
div.main .content .markdown img {
max-width: 110%;
width: 110%;
margin-left: -4%;
}
div.main .content .markdown pre {
width: 110%;
margin-left: -4%;
}
</style>
<noscript>
<link href="https://fonts.googleapis.com/css?family=Raleway:400,600,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Merriweather:300,300i,700,700i" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700" rel="stylesheet">
</noscript>
<style type="text/css" media="screen">
.hljs{display:block;background:white;padding:0.5em;color:#333333;overflow-x:auto}.hljs-comment,.hljs-meta{color:#969896}.hljs-string,.hljs-variable,.hljs-template-variable,.hljs-strong,.hljs-emphasis,.hljs-quote{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#a71d5d}.hljs-literal,.hljs-symbol,.hljs-bullet,.hljs-attribute{color:#0086b3}.hljs-section,.hljs-name{color:#63a35c}.hljs-tag{color:#333333}.hljs-title,.hljs-attr,.hljs-selector-id,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo{color:#795da3}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}
</style>
<style type="text/css" media="screen">
.progressive{overflow:hidden;position:relative;background:#efefef}.progressive__img{width:100%;height:100%;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0)}.progressive--not-loaded{filter:blur(30px);-webkit-filter:blur(30px)}.progressive--is-loaded{filter:blur(20px);-webkit-filter:blur(20px);-webkit-animation:sharpen .5s both;animation:sharpen .5s both}@-webkit-keyframes sharpen{from{filter:blur(20px);-webkit-filter:blur(20px)}to{filter:blur(0);-webkit-filter:blur(0)}}@keyframes sharpen{from{filter:blur(20px);-webkit-filter:blur(20px)}to{filter:blur(0);-webkit-filter:blur(0)}}
</style>
<link rel="shortcut icon"
href="https://ettore.dreucci.it/img/general/favicon.ico"
>
</head>
<body>
<div class="header column">
<div class="container">
<a href="https://ettore.dreucci.it/"><img class="logo" src="https://ettore.dreucci.it/img/general/calvin.png" alt="logo"></a>
<div class="content">
<a href="https://ettore.dreucci.it/"><div class="name"><h1>Ettore Dreucci</h1></div></a>
<nav>
<ul>
<li><a href="https://ettore.dreucci.it/blog/">Blog</a></li>
<li><a href="https://ettore.dreucci.it/about/">About</a></li>
<li><a href="https://ettore.dreucci.it/contacts/">Contacts</a></li>
</ul>
</nav>
</div>
</div>
</div>
<div class="main post non-narrow zero-top-spacing column">
<div class="container">
<div class="content">
<div class="front-matter">
<div class="title-container">
<div class="page-heading">
ISPConfig Dynamic DNS
</div>
</div>
<div class="desc">How to create and update a DDNS entry in ISPConfig</div>
<div class="meta">
<div class="date" title="Wed 22 May 2019 18:54:00 CEST">22 May 2019</div>
<div class="reading-time middot">3 minute read</div>
<div class="tags">
<ul>
<li class="middot"><a href="https://ettore.dreucci.it/tags/ispconfig">ispconfig</a> </li>
<li class="middot"><a href="https://ettore.dreucci.it/tags/ddns">ddns</a> </li>
<li class="middot"><a href="https://ettore.dreucci.it/tags/dns">dns</a> </li>
</ul>
</div>
<div class="tags">
<ul>
</ul>
</div>
</div>
</div>
<div class="markdown">
<p>If you manage your DNS server(s) with ISPConfig you may want a <em>dynamic entry</em> that gets updated automatically every time the target host changes its IP address.</p>
<p>Doing so in ISPConfig is quite straight forward: we can use the <a href="https://git.ispconfig.org/ispconfig/ispconfig3/tree/master/remoting_client">ISPConfig SOAP API</a> to update an <u>existing record</u> with a PHP script to be run frequently by the target host.</p>
<p>In this <a href="https://ettore.dreucci.it/categories/recipe/"><strong>recipe</strong></a> I will consider <strong>updating an A record</strong>.</p>
<ol>
<li><p>First we need to create a remote user on the ISPConfig master server to authenticate, and grant it remote access and some functions:</p>
<p>In “System -&gt; Remote User” add a new remote user, enable remote access and <strong>grant</strong><u>DNS zone functions</u>” and <u>each DNS functions corresponding to the type of record you want to update</u>: <strong>so if you want to update an A record you must grant the generic “DNS zone functions” and the “DNS a functions”</strong></p></li>
<li><p>We then have to write a PHP script that will make a SOAP function call to the ISPConfig endpoint. <u>The target host</u>, or the host executing the script <u>must have the <a href="https://www.php.net/manual/en/book.soap.php">PHP SOAP module</a> installed</u>.</p>
<p>Create the <code>update.php</code> script as follow:</p>
<pre><code>&lt;?php
require('config.php');
if ($argc&lt;3) {
print &quot;Usage: php ./update.php HOST DOMAIN [IP]\n&quot;;
print &quot;If not given, the ip address will be queried from icanhazip.com\n&quot;;
die();
}
// First parameter: hostname of DNS entry
$ddns_host = $argv[1];
// Second: domain name of DNS zone
$domain = $argv[2];
// If third parameter is present
if ($argc&gt;3) {
// Third parameter: IP address of target host
$ip = $argv[3];
// Otherwise
} else {
// Figure out the public IP of this host:
$ip = trim(file_get_contents(&quot;http://icanhazip.com/&quot;));
if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
die(&quot;Unable to retrieve public IP address (icanhazip.com returned $ip)\n&quot;);
}
}
print(&quot;Setting DDNS host $ddns_host.$domain to IP $ip\n&quot;);
// Using the SOAP module initialize a SoapClient
$client = new SoapClient(null,
array('location' =&gt; $soap_location,
'uri' =&gt; $soap_uri,
'trace' =&gt; 1,
'exceptions' =&gt; 1));
try {
// Login to SOAP server
$session_id = $client-&gt;login($soap_user, $soap_password);
// Grab DNS zone ID
$zone_id = $client-&gt;dns_zone_get_id($session_id, $domain);
// Grab DNS zone
$zone = $client-&gt;dns_zone_get($session_id, $zone_id);
// Grab DNS records
$records = $client-&gt;dns_rr_get_all_by_zone($session_id, $zone_id);
// Find right record: hostname must match and type must be A
$dns_record = null;
foreach ($records as $rec) {
if ($rec['type']=='A' &amp;&amp; $rec['name']==$ddns_host) {
$dns_record = $rec;
}
}
// If no record found
if (is_null($dns_record)) {
//Logout from SOAP server
$client-&gt;logout($session_id);
die(&quot;Unable to find DNS record for host $ddns_host in domain $domain on the server...\n&quot;);
}
// If IP stored in record is different from current IP
if ($dns_record['data'] != $ip) {
// Set new IP
$dns_record['data'] = $ip;
// Increment record serial number
$dns_record['serial'] = $dns_record['serial']+1;
// Update modified record in DNS server
$client-&gt;dns_a_update($session_id, null, $dns_record['id'], $dns_record);
// Increment zone serial number
$zone['serial'] = $zone['serial'] + 1;
// Update modified zone in DNS server
$client-&gt;dns_zone_update($session_id, 0, $zone_id, $zone);
print(&quot;Successfully set DNS entry for host $ddns_host in domain $domain to $ip.\n&quot;);
// Otherwise
} else {
print(&quot;IP address of $ddns_host.$domain already set to $ip.\n&quot;);
}
//Logout from SOAP server
$client-&gt;logout($session_id);
} catch (SoapFault $e) {
die('SOAP Error: '.$e-&gt;getMessage().&quot;\n&quot;);
}
?&gt;
</code></pre>
<p>Create the <code>config.php</code> as follow:</p>
<pre><code>&lt;?php
$soap_location = 'https://ispconfig.example.com:8080/remote/index.php';
$soap_uri = 'https://ispconfig.example.com:8080/remote/';
$soap_user = 'username';
$soap_password = 'password';
</code></pre></li>
<li><p>Schedule the execution of <code>update.php</code></p></li>
</ol>
<p>END.</p>
</div>
<br>
<div class="navigation">
<div style="width: 100%;"></div>
</div>
</div>
</div>
</div>
<div class="footer column">
<div class="container">
<div class="copyright">
</div>
<div class="icons">
<a href="https://github.com/noettore" rel=me target="_blank">
<img class="icon" src="https://ettore.dreucci.it/img/github.svg" alt="github" />
</a>
<a href="https://www.linkedin.com/in/ettore-dreucci-403110175" rel=me target="_blank">
<img class="icon" src="https://ettore.dreucci.it/img/linkedin.svg" alt="linkedin" />
</a>
<a href="https://ettore.dreucci.it/index.xml">
<img class="icon" src="https://ettore.dreucci.it/img/rss.svg" alt="rss" />
</a>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ['Raleway:400,600,700', 'Merriweather:300,300i,700,700i', 'Ubuntu+Mono:400,700']
}
});
</script>
<script src="https://ettore.dreucci.it/js/highlight.min.js" defer></script>
<script src="https://ettore.dreucci.it/js/progressively.min.js" defer></script>
<script>
window.onload = function() {
hljs.initHighlighting();
progressively.init({delay: 30, throttle: 50});
};
</script>
</body>
</html>