mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Handle short DHCP hostnames
This commit is contained in:
@@ -20,6 +20,11 @@ foreach $d (@d) {
|
||||
}
|
||||
($fn, $recs) = &get_dns_zone();
|
||||
($old) = grep { lc($_->{'name'}) eq lc($d).'.' } @$recs;
|
||||
if (!$old) {
|
||||
# Search by hostname only
|
||||
($old) = grep { lc($_->{'name'}) eq
|
||||
lc($d).'.'.lc($config{'domain'}).'.' } @$recs;
|
||||
}
|
||||
if ($old) {
|
||||
&bind8::delete_record($fn, $old);
|
||||
&bind8::bump_soa_record($fn, $recs);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
desc=DHCP and DNS Hosts
|
||||
category=servers
|
||||
depends=bind8 dhcpd net
|
||||
version=1.4
|
||||
version=1.5
|
||||
|
||||
@@ -7,11 +7,15 @@ require './dhcp-dns-lib.pl';
|
||||
@hosts = &list_dhcp_hosts();
|
||||
($fn, $recs) = &get_dns_zone();
|
||||
if (!$in{'new'}) {
|
||||
# Get existing host object
|
||||
# Get existing host object and DNS record
|
||||
($host) = grep { $_->{'values'}->[0] eq $in{'old'} } @hosts;
|
||||
$host || &error($text{'edit_egone'});
|
||||
$oldpar = $host->{'parent'};
|
||||
($old) = grep { lc($_->{'name'}) eq lc($in{'old'}).'.' } @$recs;
|
||||
if (!$old) {
|
||||
($old) = grep { lc($_->{'name'}) eq
|
||||
lc($in{'old'}).'.'.lc($config{'domain'}).'.' } @$recs;
|
||||
}
|
||||
if ($in{'subnet'} eq $in{'oldsubnet'}) {
|
||||
$par = $oldpar;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user