Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I originally posted this in LinuxQuestions http://www.linuxquestions.org/questions/linux-server-73/dhcp-is-mangling-my-ptr-records-in-dns-4175412344/ without much luck, so I'll try here.

DHCP is repeating the first three octets when it adds a PTR record. From my messages log:

dhcpd: added reverse map from 10.2.168.192.2.168.192.in-addr.arpa to FTIR.Adherent.lab

I'm sure it is something stupid like a missing period, but I haven't been able to figure it out.

This happens on both the 192.168.2.xyz and 192.168.4.xyz networks.

Notice that the FTIR computer is already in the hosts and ptr files but a new entry still gets added. Also, nowhere in my configuration files do I have Adherent with a capital A, but the capitalized version shows up in the mangled file.

My DHCP/BIND server is Ubuntu Linux but all of the network computers are Windows. Here is my system info:

$ uname -a
Linux ATI-DHCP.adherent.lan 2.6.32-41-server #90-Ubuntu SMP Tue May 22 12:41:40 UTC 2012 x86_64 GNU/Linux
$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 10.04.4 LTS
Release:        10.04
Codename:       lucid
$ named -v
BIND 9.7.0-P1

Here are my various configuration files:

dhcpd.conf:

ddns-update-style interim;
ddns-updates on;
authoritative;

log-facility local1;

default-lease-time 86400;
max-lease-time 259200;

include "/etc/dhcp3/ddns.key";

# Adherent internal network with internet access
zone adherent.lan. {
    primary 192.168.1.201;
    key ddns;
    }

# Reverse zone for 192.168.1.xyz
zone 1.168.192.in-addr.arpa. {
    primary 192.168.1.201;
    key ddns;
    }

# Adherent insecure network-NO internet access
zone lab.adherent.lan. {
    primary 192.168.2.201;
    key ddns;
    }

# Reverse zone for 192.168.2.xyz
zone 2.168.192.in-addr.arpa. {
    primary 192.168.2.201;
    key ddns;
    }

# Guest-Internet only
zone guest.adherent.lan. {
    primary 192.168.4.201;
    key ddns;
    }

# Reverse zone for 192.168.4.xyz
zone 4.168.192.in-addr.arpa. {
    primary 192.168.4.201;
    key ddns;
    }

# ATI shared network:  Internal (192.168.1.xyz) and visitor (192.168.4.xyz) nets
shared-network ATIshared {

    # ATI internal
    subnet 192.168.1.0 netmask 255.255.255.0 {
        #range 192.168.1.10 192.168.1.19;
        deny unknown-clients;
        ddns-domainname "adherent.lan";
        ddns-rev-domainname "1.168.192.in-addr.arpa";
        option domain-name "adherent.lan";
        option routers 192.168.1.201;
        option domain-name-servers 192.168.1.201;
        }

    # Visitor subnet
    subnet 192.168.4.0 netmask 255.255.255.0 {
        default-lease-time 3600;
        range 192.168.4.40 192.168.4.49;
        allow unknown-clients;
        ddns-domainname "guest.adherent.lan";
        ddns-rev-domainname "4.168.192.in-addr.arpa";
        option domain-name "guest.adherent.lan";
        option routers 192.168.4.201;
        option domain-name-servers 192.168.4.201;
        }
    }

# Adherent insecure network-NO internet access (192.168.2.xyz)
subnet 192.168.2.0 netmask 255.255.255.0 {
    range 192.168.2.240 192.168.2.250;
    ddns-domainname "lab.adherent.lan";
    ddns-rev-domainname "2.168.192.in-addr.arpa";
    option domain-name "lab.adherent.lan";
    option routers 192.168.2.101;
    option domain-name-servers 192.168.2.201;
    }

include "/etc/dhcp3/hosts.dhcp3";

named.conf.local

include "/etc/bind/zones.rfc1918";

include "/etc/bind/ddns.key";

###########################################################
# Adherent main zone.  
# All addresses are fixed and from 192.168.1.0/24
# If DHCP doesn't have an entry for a computer, it gets put in the guest zone.
#
zone "adherent.lan" {
    type master;
    file "/var/lib/bind/adherent.lan.hosts";
    allow-update { key ddns ;};
};

zone "1.168.192.in-addr.arpa" {
    type master;
    file "/var/lib/bind/192.168.1.rev";
    allow-update { key ddns ;};
};

###########################################################
# Adherent lab zone.  
# All addresses are from 192.168.2.0/24
# Doesn't matter if DHCP has an entry for the computer.

zone "lab.adherent.lan" {
    type master;
    file "/var/lib/bind/adherent-lab.lan.hosts";
    allow-update { key ddns ;};
};

zone "2.168.192.in-addr.arpa" {
        type master;
        file "/var/lib/bind/192.168.2.rev";
        allow-update { key ddns ;};
};

###########################################################
# Adherent guest zone.  
# All addresses are from 192.168.4.0/24
# If DHCP doesn't have an entry for a computer, it gets put in this zone.
#
zone "guest.adherent.lan" {
    type master;
    file "/var/lib/bind/adherent-guest.lan.hosts";
    allow-update { key ddns ;};
};

zone "4.168.192.in-addr.arpa" {
    type master;
    file "/var/lib/bind/192.168.4.rev";
    allow-update { key ddns ;};
};

file /var/lib/bind/adherent-lab.lan.hosts

$ttl 3h
@       IN      SOA     ATI-DHCP.adherent.lan. bgordon.adherent-tech.com. (
                        2012061801      ; serial
                        3h              ; Refresh
                        1h              ; Retry
                        1w              ; Expire
                        1h              ; Minimum
                        )
@       IN      NS      ATI-DHCP.adherent.lan.

FTIR        IN  A   192.168.2.10
GCMS        IN  A   192.168.2.12
datalogg    IN  A   192.168.2.13
TA      IN  A   192.168.2.14
instron     IN  A   192.168.2.20
instron2    IN  A   192.168.2.21

file /var/lib/bind/192.168.2.rev

$TTL 3h
@   IN SOA  ATI-DHCP.adherent.lan. bgordon.adherent-tech.com. (
                2012061801  ; serial
                3h      ; refresh (3 hours)
                1h      ; retry (1 hour)
                1w      ; expire (1 week)
                1h      ; minimum (1 hour)
                )
@           NS  ATI-DHCP.adherent.lan.
10          PTR FTIR.lab.adherent.lan.
12          PTR GCMS.lab.adherent.lan.
13          PTR datalogg.lab.adherent.lan.
14          PTR TA.lab.adherent.lan.
20          PTR instron.lab.adherent.lan.
21          PTR instron2.lab.adherent.lan.

Same file after mangling (all changes made by DHCP/BIND:

$ORIGIN .
$TTL 10800  ; 3 hours
2.168.192.in-addr.arpa  IN SOA  ATI-DHCP.adherent.lan. bgordon.adherent-tech.com. (
                2012061802 ; serial
                10800      ; refresh (3 hours)
                3600       ; retry (1 hour)
            604800     ; expire (1 week)
            3600       ; minimum (1 hour)
            )
            NS  ATI-DHCP.adherent.lan.
$ORIGIN 2.168.192.in-addr.arpa.
10          PTR FTIR.lab.adherent.lan.
12          PTR GCMS.lab.adherent.lan.
13          PTR datalogg.lab.adherent.lan.
14          PTR TA.lab.adherent.lan.
$TTL 43200  ; 12 hours
10.2.168.192        PTR FTIR.Adherent.lab.
$TTL 10800  ; 3 hours
20          PTR instron.lab.adherent.lan.
21          PTR instron2.lab.adherent.lan.
share|improve this question

1 Answer 1

I got an answer over in my original posting on LinuxQuestions. The lines in dhcp.conf, for each subnet definintion, like:

ddns-rev-domainname "1.168.192.in-addr.arpa";
ddns-rev-domainname "2.168.192.in-addr.arpa";
ddns-rev-domainname "4.168.192.in-addr.arpa";

should all be:

ddns-rev-domainname "in-addr.arpa.";

I'm not sure if the dot after arpa is required, but it works with it there.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.