Solved

DHCP lease

Posted on 2014-02-26
10
1,639 Views
Last Modified: 2014-03-10
If I lower the lease time to 1 day and delete the lease out of DHCP. Will the machine grab a new lease IP and register DNS right away?
0
Comment
Question by:Thomas N
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 13

Expert Comment

by:Santosh Gupta
Comment Utility
if "Dynamically update DNS A and PTR records for DHCP clients..." is enabled in DHCP server.
then yes, machines will take the IP and it will register in DNS.
0
 
LVL 35

Expert Comment

by:Mahesh
Comment Utility
Yes, this will work if following conditions are true

DNS updates can be sent for any one of the following reasons or events:
•An IP address is added, removed, or modified in the TCP/IP properties configuration for any one of the installed network connections.
•An IP address lease changes or renews any one of the installed network connections with the DHCP server. For example, this update occurs when the computer is started or when you use the ipconfig /renew command.
•You use the ipconfig /registerdns command to manually force an update of the client name registration in DNS.
•The computer is turned on.
•A member server is promoted to a domain controller.

In order to work with DHCP lease and DNS dynamic update following must be configured properly

You have to set secure dynamic updates to secure only in dns zone properties

In the properties of DHCP server (Ipv4 in case of 2008 DHCP server), on the DNS tab if have set Always dynamically update DNS A and PTR records, then DHCP server will always update host (A) and PTR records on behalf of clients
OR
In the properties of DHCP server (Ipv4 in case of 2008 DHCP server), on the DNS tab if have set Dynamically update DNS A and PTR records only if requested by the DHCP clients
In this case if IP lease has changed then client computers will dynamically update DNS records and DHCP server will update PTR records
However,
If DHCP server is installed on domain controller, then you must set domain service account in DHCP server properties (IPV4 in case of 2008) \ advanced \ credentials tab in order to dynamic update work correctly, otherwise it will fail.

Also you must set "Discard A and PTR records when dhcp lease expires" in order to delete expired DHCP leases from DHCP console automatically, otherwise you must delete expired DHCP leases from DHCP console manually.
Note that this will not delete DNS records automatically unless you setup DNS scavenging properly
http://social.technet.microsoft.com/Forums/windowsserver/en-US/8d4b5f8e-3290-4a9b-8f9d-68fafdd895a2/dhcp-service-not-siscarding-a-and-ptr-records-in-dns-when-lease-is-deleted

Check below article for DHCP lease process in depth
http://technet.microsoft.com/en-us/library/cc958935.aspx

Check below articles for more information
http://support.microsoft.com/kb/816592
http://technet.microsoft.com/en-us/library/dd145315(v=ws.10).aspx - Configure secure Dynamic Update

let me know if you have any specific question please

Mahesh
0
 
LVL 11

Expert Comment

by:BillBondo
Comment Utility
Just to add to sgupta1181, I believe deleting the entry has no effect on the computer. It will at 50% if i remember begin polling for a new address and more than likely receive the same address again.
0
 
LVL 16

Expert Comment

by:vivigatt
Comment Utility
BillBondo is right.
DHCP clients usually try to renew their lease when it half expired.
Deleting a lease on the DHCP server side does not instruct the client to renew its DHCP lease.
To do so, you must explicitly run some commands to renew DHCP or, better, to release the lease and then "renew it" (since a renewal is by definition done with the same IP address).
Under Windows, the commands are:
ipconfig /release
ipconfig /renew
(you can be more specific by specifying the adapter to use. ipconfig /? for more details).
Regarding automatic DNS registration, this depends on your hosts, dhcp server/DNS integration etc.
What OS run on your clients and server(s)?
0
 

Author Comment

by:Thomas N
Comment Utility
Deleting the lease wont but wont lowering the lease time get them to report in and get a different IP address?

Im using 2008 server and XP\Win7 machines.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 35

Expert Comment

by:Mahesh
Comment Utility
DNS records will be updated when DHCP lease changed if DNS -DHCP integration is configured correctly as per my 1st comment

However, different DHCP IP for existing clients is bit difficult for 1day lease period
Because DHCP client will request for renewal after 12 HRs from obtaining lease and if that not happened since client may be shutdown \ disconnected from network earlier, the still lease will remain on DHCP server for 24 HRS and will be deleted after expiry, but its not immediate task and it will happens every Hour with DHCP cleanup cycle. If client reports to DHCP prior to deletion of expired record from DHCP, DHCP server will simply grant that IP to clients again.

For Ex: morning 8.00AM client A get IP lease, he left for the day at 6.00PM
Now Lease will be left in DHCP until 8.00AM tomorrow

If client came tomorrow again at 8.00AM hopefully it will get same IP lease because now its lease is expired but not deleted from DHCP immediately because of waiting for clean up cycle to run and client is trying to request same lease as yesterday and if available DHCP will grant it
According to my knowledge, every 60 minutes DHCP will cleanup expired leases.

It not necessarily possible that lease will get deleted from DHCP right at 8.00 AM It depends upon last cleanup cycle

Check below article for more information
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Frzakg%2Frzakgconceptleases.htm

Also its not recommended to set lower lease than this because this will create to many stale records in DNS and you need to lower scavenging setting also to cleanup this mess which is not recommended as it may produce undesired results

The workaround I can see around this provided that you are not running 24\7 shifts.
Instead of lowering lease duration, Delete all dynamic lease from DHCP by means of some script \ sc tasks \ command every night so that there is no trace left on DHCP server regarding previous lease and hopefully it will provide new leases to clients on 1st come 1st basis.
Again you need to set your DNS scavenging accordingly because it will trigger to many stale records in DNS which is undesirable
Check below articles for settings up scavenging in relation with DHCP lease period
http://blogs.technet.com/b/askpfe/archive/2011/06/03/how-dns-scavenging-and-the-dhcp-lease-duration-relate.aspx
http://social.technet.microsoft.com/Forums/windowsserver/en-US/bb556cfb-3217-4dcf-af4f-460366faa1b8/best-practices-configuration-for-dns-server-on-windows-2008-r2-server-agingscavenging-etc?forum=winserverNIS

Let me know what is the exactly your issue please

Mahesh
0
 

Author Comment

by:Thomas N
Comment Utility
I was having issues with the DHCP server register DNS names but I found out and not that I wanted my machines to get new IP address, more that I wanted them to automatically register to DNS. I have over 3k machines and did not want to register them each manually. What could I do to get this done? Script? Thanks for all your help.
0
 
LVL 11

Expert Comment

by:BillBondo
Comment Utility
I believe that is a default setting in the dhcp scope properties.
0
 
LVL 35

Accepted Solution

by:
Mahesh earned 500 total points
Comment Utility
Thanks for confirmation.

In that case please check my 1st comment and verify you DHCP and DNS settings are set accordingly
may be you are running DHCP on Domain controller, in that case you must set credentials in DHCP properties, please check my comment for details

Also find one more excellent article related to this
https://msmvps.com/blogs/acefekay/archive/2009/08/20/dhcp-dynamic-dns-updates-scavenging-static-entries-amp-timestamps-and-the-dnsproxyupdate-group.aspx

Let me know if you have any queries related to dns - dhcp integration

Mahesh
0
 
LVL 16

Expert Comment

by:vivigatt
Comment Utility
What OSes run your DNS and DHCP services?
0

Featured Post

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now