[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2030
  • Last Modified:

DHCP lease

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
Thomas N
Asked:
Thomas N
  • 3
  • 2
  • 2
  • +2
1 Solution
 
Santosh GuptaCommented:
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
 
MaheshArchitectCommented:
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
 
BillBondoCommented:
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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
vivigattCommented:
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
 
Thomas NAuthor Commented:
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
 
MaheshArchitectCommented:
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
 
Thomas NAuthor Commented:
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
 
BillBondoCommented:
I believe that is a default setting in the dhcp scope properties.
0
 
MaheshArchitectCommented:
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
 
vivigattCommented:
What OSes run your DNS and DHCP services?
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now