LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-02-2019, 01:07 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
Purging old host names from reverse-zone file


I'm running Slackware64 14.2, kernel 4.4.182, BIND 9.11.9.

While monitoring iftop, I noticed some old host names popping up. These are for computers that have been since has their hostnames changed, yet the new host names don't show.

I found the old host names in my reverse zone file:
Code:
52                      PTR     BRIANVM.hprs.local.
53                      PTR     DESKTOP-UMPPGUP.hprs.local.
56                      PTR     DESKTOP-NSGIEI3.hprs.local.
These IPs now have new hostnames:
Code:
192.168.0.52  MIKE.hprs.local
192.168.0.53  SUSAN.hprs.local
192.168.0.56  HOLLY.hprs.local
These host names ARE NOT in the reverse zone file, but they are in the /etc/dhcpd.conf file. E.g.:
Code:
host HOLLY {
    hardware ethernet 12:72:42:72:A2:E2;
    fixed-address 192.168.0.56;
}
and I get the right IP when looking up:
Code:
> host HOLLY
holly.hprs.local has address 192.168.0.56

# but not when reverse lookup:

> host 192.168.0.56
56.0.168.192.in-addr.arpa domain name pointer DESKTOP-NSGIEI3.hprs.local.
The old hostnames that begin with "DESKTOP-" are probably what happened when I upgraded these computers to Windows 10 (scratch install, not actual "upgrade"). They got the randomly assigned hostname Windows gives when it first boots. I then changed the computers to the correct hostname (e.g. HOLLY) when finishing the config. Interestingly, the "correct" hostname is the same name the computer had when running Windows 7, yet that old name is no longer in the reverse zone file.

So, why is the reverse-zone file not getting updated with the new/correct host names?

What can I do to fix this?

Last edited by mfoley; 12-02-2019 at 01:13 PM.
 
Old 12-03-2019, 09:47 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Why do you expect the maintenance of your name server to be automatic?

If there are incorrect entries in your zone files, fix them.
 
Old 01-27-2020, 12:35 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by scasey View Post
Why do you expect the maintenance of your name server to be automatic?

If there are incorrect entries in your zone files, fix them.
Well, yes actually, I did expect it to be automatic. The hosts name/IP entries get into DNS x.local.zone file automatically, and the rDNS entries also apparently get in there automatically as with my example with DESKTOP-NSGIEI3.hprs.local. I didn't manually add that to the rDNS file -- it was automatic. So, yes, I did expect changes to hostnames and IPs get automatically updated.

However, if it's not automatic, it's not; regardless of my expectations. So, given that, how do you advise that I "fix them"? Is there a rndc function for this? Do I manually edit the zone file? If the latter, do I need to stop named first? I've not done this before and I've found nothing in the web to guide me.

Last edited by mfoley; 01-27-2020 at 12:38 PM.
 
Old 01-30-2020, 01:41 AM   #4
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
OK, I figured out a way to do what I want, but I'm not sure it's the "best practice" way. Using nsupdate:
Code:
> nsupdate                 
> update delete 52.0.168.192.in-addr.arpa PTR
> update delete 63.0.168.192.in-addr.arpa PTR
> update delete 102.0.168.192.in-addr.arpa PTR
> update delete 175.0.168.192.in-addr.arpa. PTR
> send
After doing this I either have to restart bind or run 'rndc -V sync -clean'. Otherwise, the changes do not "take". Does this seem right?

Also, deleting the PTR records has no effect on the A or TXT records. So, to delete an obsolete host entirely I have to (assuming that host mpress is at 192.168.0.63):
Code:
> nsupdate                 
> update delete 63.0.168.192.in-addr.arpa. PTR
> update delete mpress.hprs.local. A
> update delete mpress.hprs.local. TXT
> send
Now, in this example, host 192.168.0.63 still exists, but has a different host name: "mike". The A and TXT records are in the zone file (added automatically, I might add), but now there is no PTR record for this IP in the rDNS zone file.

Do I have to add that manually or will it eventually appear? Note that when I add a new host to the network, it does appear in the both the zone file and reverse-zone file with A, TXT and PTR records. I've never added those manually after adding a host to the network. However, not sure what the behavior will be once I deleted the PTR record for that IP.

Thots?

Last edited by mfoley; 01-30-2020 at 02:45 AM.
 
Old 01-31-2020, 10:07 AM   #5
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
More than a day later host 'mike' has not appeared in the reverse-zone-file (PTR). I added a new host 'dbserverx' to the LAN a couple of weeks ago and it automatically appeared in the zone-file (A, TXT) and reverse-zone-file. Why would 'dbserverx' get automatically added to these zone-files, but 'mike' does not?

Could really used some help from any dns/network LQ experts.
 
  


Reply

Tags
bind9, dhcpd, zone files



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Reverse Zone - ignoring out-of-zone data haraldboehmecke Linux - Networking 1 03-28-2017 04:02 AM
I find file zone in the slave zone to the do a transfer of zone from Windows Server 2012 as master dns and CentOS as slave DNS. To learn Linux - Newbie 1 09-02-2016 09:36 AM
Which zone bind dns work either in forward zone are reverse zone sanjay87 Linux - Server 2 06-05-2012 04:21 AM
BIND forward zone OK, reverse zone NOT OK! n03x3c Linux - Server 2 11-05-2008 10:31 PM
why is bind updating reverse zone with updating zone 202.1.168.192.1.168.192.in-addr marcobjorge Linux - Networking 5 10-12-2008 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration