Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DHCP lease

Posted on 2014-02-26
10
Medium Priority
?
1,966 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 38

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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 17

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
 
LVL 38

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 38

Accepted Solution

by:
Mahesh earned 2000 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 17

Expert Comment

by:vivigatt
ID: 39894435
What OSes run your DNS and DHCP services?
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

618 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