Re: dns cleanup - delete all PTR records refering to a certain hostname

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




first of all thanks for your reply.
I guess I will just copy the windows client behaviour. Disregard old PTR
records and add/update new ones as applicable.

As far as I can see Windows clients don't care about old PTR records
either. Or does it appear like that because they were added manually
for testing purposes?
Your first statement is true, the question can only be answered if
you knew someone was actually doing this.
I do know because that someone was me. I believe Windows clients remove
their last valid PTR upon ip changes. Probably before updating the
records they first check for the old A record and try to find the
matching PTR this way. If the corresponding pointer exists it is removed
and new A and PTR records are added. I will log some packets and verify
this tomorrow.




Kevin D. Goodknecht Sr. [MVP] wrote:
roman sommer wrote:
hello everyone,

I am writing a perl script which is (securely) updating A and PTR
records of *nix clients in a Microsoft environment (Microsoft Windows
2003 R2 servers in native mode). I need to know how Windows clients
update their PTR record. As far as I can see I can only query for an
ip address and get a hostname in return. I want to make sure I delete
*all* PTR resource records refering to a specific hostname before
adding the new one. To cut a long story short: "my hostname is
samehost.example.domain.com, delete all my existing PTR records".

If PTR records where registered by hostname it might work, but PTRs are
registered by IP number, not the data it contains. Just like A records,
which can have many records with the same name but different IPs, you can
have many PTRs with the same name, with different hostnames.
It would be unfeasible to lookup an A record by it IP, and it is unfeasible
to lookup a PTR by its hostname.
The problem is when a host leaves its PTR behind when it gets a new IP, it
cannot update the previous PTR because it no longer has the IP and doesn't
know it had it. So, it creates another.

I think the real trick would be having the client remove the record before
it gets disconnected. Laptop users are notorious for this and it is
unenforceable on them.

Two ways to keep the reverse lookup zone clean are; 1, enable scavenging on
the zone which is going to have some outdated PTRs; 2, Make the DHCP server
owner of all records and responsible for all registration so it can remove
old records as the lease expires.


As far as I can see Windows clients don't care about old PTR records
either. Or does it appear like that because they were added manually
for testing purposes?
Your first statement is true, the question can only be answered if you knew
someone was actually doing this.

.



Relevant Pages

  • Re: Networking -- use of two Internet connections for one server with round robin DNS -&
    ... -Check that sender IP address has a PTR. ... -Check that HELO resolves in public DNS either to a domain or an A ... use the PTR hostname for anything, as it is long and rambling, though ... I occasionally use telnet to connect to a mail server to verify ...
    (Debian-User)
  • Word Count optimization
    ... The obvious algorithm would use a 256-byte lookup table to handle 8-bit characters, storing the resulting bits in successive bit locations in a resulting byte. ... By storing either 00h or 0FFh in the lookup table, we can avoid the need for shift operations to merge the individual bits, instead use explicit masks in an 8-way unrolled loop: ... movzx ebx, byte ptr ... movzx edx, byte ptr table ...
    (comp.lang.asm.x86)
  • Re: IP ADDRESS
    ... machines in DNS or RDNS, or that you have them all in DNS & RDNS. ... GET THE HOSTNAME FOR THE DEVICE ... LNS = DCOUNT) ... FOR PTR = 1 TO LNS ...
    (comp.databases.pick)
  • Re: help with subroutines and reading/writing to file
    ... I don't think your script will work as you ... Here's a ptr lookup using dig ... ... This is how I lookup ptr-records ... ...
    (perl.beginners)
  • Re: Need a hand deciphering this NDR
    ... the PTR lookup was initially done by www.dnsreport.com and both came ... Our mailserver, however, is not configured to do reverse lookups... ...
    (microsoft.public.exchange.setup)