Skip to content

Commit c9ff28a

Browse files
committed
Warn about CNAME target missing, #6733
1 parent bcb8eb1 commit c9ff28a

27 files changed

+40
-0
lines changed

interface/web/dns/dns_cname_edit.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ function onSubmit() {
6161
if($this->dataRecord["data"] === '@') {
6262
$this->dataRecord["data"] = $soa['origin'];
6363
}
64+
65+
// The target name should either end in a . or exist in the current zone.
66+
if (!empty($this->dataRecord["data"]) && substr($this->dataRecord["data"], -1) != '.') {
67+
$tmp = $app->db->queryOneRecord("SELECT dns_rr.id
68+
FROM dns_rr
69+
LEFT JOIN dns_soa ON dns_rr.zone = dns_soa.id
70+
WHERE (name = ?
71+
OR name = CONCAT(?, '.', dns_soa.origin)) AND dns_rr.zone = ?",
72+
$this->dataRecord["data"], $this->dataRecord["data"], $this->dataRecord["zone"]);
73+
74+
if (empty($tmp)) {
75+
$app->tform->errorMessage .= $app->tform->wordbook['data_error_not_found'] . '<br/>';
76+
}
77+
}
6478
parent::onSubmit();
6579
}
6680
}

interface/web/dns/lib/lang/ar_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = 'Target hostname empty';
1414
$wb['data_error_regex'] = 'Target hostname format invalid';
1515
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

interface/web/dns/lib/lang/bg_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = 'Target hostname empty';
1414
$wb['data_error_regex'] = 'Target hostname format invalid';
1515
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Минималния TTL е 60 секунди.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

interface/web/dns/lib/lang/br_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ $wb['data_error_empty'] = 'O alvo do host está vazio.';
1414
$wb['data_error_regex'] = 'O alvo do host possui formato inválido.';
1515
$wb['data_error_duplicate'] = 'Registro A, AAAA, ALIAS, CNAME ou DNAME duplicado';
1616
$wb['ttl_range_error'] = 'O TTL mínimo são 60 segundos.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';

interface/web/dns/lib/lang/ca_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = 'Le nom d\'hôte cible est vide.';
1414
$wb['data_error_regex'] = 'Le format du nom d\'hôte cible invalide.';
1515
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

interface/web/dns/lib/lang/cn_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = '目标主机名为空。';
1414
$wb['data_error_regex'] = '目标主机名格式无效。';
1515
$wb['data_error_duplicate'] = '重复的 A、AAAA、ALIAS、CNAME 或 DNAME 记录。';
1616
$wb['ttl_range_error'] = '最小 TTL 时间为 60 秒。';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

interface/web/dns/lib/lang/cz_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ $wb['data_error_empty'] = 'Cílový název hostitele je prázdný';
1414
$wb['data_error_regex'] = 'Cílový název hostitele má chybný formát';
1515
$wb['data_error_duplicate'] = 'Duplikace A záznamu nebo CNAME-záznamu';
1616
$wb['ttl_range_error'] = 'Min. TTL doba je 60 sekund.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';

interface/web/dns/lib/lang/de_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = 'Ziel Hostname ist leer';
1414
$wb['data_error_regex'] = 'Ziel Hostname Format ist ungültig';
1515
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

interface/web/dns/lib/lang/dk_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = 'Mål-værtsnavn er tom';
1414
$wb['data_error_regex'] = 'Mål-værtsnavn format er ugyldigt';
1515
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL tid er 60 sekunder.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

interface/web/dns/lib/lang/el_dns_cname.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ $wb['data_error_empty'] = 'Το hostname Προορισμός δεν έχει ο
1414
$wb['data_error_regex'] = 'Hostname Προορισμός με μη έγκυρη μορφοποίηση';
1515
$wb['data_error_duplicate'] = 'Duplicate A, AAAA, ALIAS, CNAME, or DNAME record';
1616
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
17+
$wb['data_error_not_found'] = 'Target hostname not found in the current zone. It should end in a . when it\'s external.';
1718
?>

0 commit comments

Comments
 (0)