Why do we need to set a lease time to a DHCP server? What happens to a client who uses that IP address while it was expired? If i set its time to 100 years, what difference does it make?
Also, i don't know why we have to set a domain name to a DHCP server. What's the idea behind it?
Best Answer
IP addresses are resources in TCP/IP networking, and they need to be managed. You can do that manually (setting all computers to static IP addresses) or you can use a DHCP server that does the management for you, based on the rules as described in RFC1531.
When a client asks for an IP address, and the DHCP server is about to "lease" the address to the client, the server has to know how long this lease should be. If leases were of indefinite length, then as soon as all IP addresses have been leased, you could not connect any new clients, even if the computers using the previously leased addresses had all stopped working. If leases were of length zero, there would be no point having them.
If a lease expires, then the server sees this a sign that this IP address can now be re-used, i.e. assigned to a different client. Should a computer use the address without the knowledge of the DHCP server, then you can end up with two computers using the same address, which would create chaos on your network (since both computers would be answering the same queries simultaneously, and these two could not talk to each other, as they would be effectively just talking to themselves).
Setting the default lease time (or any lease time for a particular lease) to 100 years makes this IP address (or any addresses leased with that time) unavailable for 100 years. As TomTom already said, this would for all intents and purposes disable the benefits of having DHCP.
Your last question doesn't make much sense, since it lacks clarity of detail. There are several options in a DHCP server that deal with DNS: