Solved

DHCP lease

Posted on 2014-02-26
10
1,669 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
ID: 39890078
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
ID: 39890133
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
ID: 39890151
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
ID: 39891874
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
ID: 39892063
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 35

Expert Comment

by:Mahesh
ID: 39892276
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
ID: 39892400
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
ID: 39892511
I believe that is a default setting in the dhcp scope properties.
0
 
LVL 35

Accepted Solution

by:
Mahesh earned 500 total points
ID: 39892521
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
ID: 39894435
What OSes run your DNS and DHCP services?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

911 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

22 Experts available now in Live!

Get 1:1 Help Now