Question on DHCP lease expiration

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question on DHCP lease expiration

David Li
Hi,

This is my first post here.

I am testing to see if an expired DHCP lease can result in the removal
of the corresponding DNS record on Centos 7.

So far I am able to let DHCP server assign an static IP based on the
host's MAC address and add a DNS A record. The host is also able to
refresh its lease every time it expires.

But when I shut down the host, I don't see the record removed after
the lease expired (5 min). Even more the syslog doesn't show any
messages from DHCP server attempting to remove the IP address and
update the BIND 9 (named) server. So I am thinking there might be
something wrong or missing in my dhcpd.conf.

Here is a snippet of my dhcpd.conf:


# DNS options

ddns-updates on;
ddns-update-style interim;
update-static-leases on;
authoritative;

allow unknown-clients;
use-host-decl-names on;
default-lease-time 300; #5 min
max-lease-time 300; #5min
log-facility local7;



# static assignment
#
host node1 {
   hardware ethernet 08:00:27:0A:C3:1C;
   fixed-address 10.4.1.11;
   ddns-hostname "node1";
}


Can anyone help to see what's missing from my configuration?

Thanks.
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on DHCP lease expiration

Shawn Routhier
The server treats dynamic and static leases differently.

Dynamic leases have a lease structure that moves between
different queues and this is how the server knows when to
expire the lease and thence when to remove it from the DNS.

Static leases don’t have a lease structure and so don’t get
expired and don’t get removed from the DNS.

regards,
Shawn

> On Feb 26, 2016, at 5:37 PM, David Li <[hidden email]> wrote:
>
> Hi,
>
> This is my first post here.
>
> I am testing to see if an expired DHCP lease can result in the removal
> of the corresponding DNS record on Centos 7.
>
> So far I am able to let DHCP server assign an static IP based on the
> host's MAC address and add a DNS A record. The host is also able to
> refresh its lease every time it expires.
>
> But when I shut down the host, I don't see the record removed after
> the lease expired (5 min). Even more the syslog doesn't show any
> messages from DHCP server attempting to remove the IP address and
> update the BIND 9 (named) server. So I am thinking there might be
> something wrong or missing in my dhcpd.conf.
>
> Here is a snippet of my dhcpd.conf:
>
>
> # DNS options
>
> ddns-updates on;
> ddns-update-style interim;
> update-static-leases on;
> authoritative;
>
> allow unknown-clients;
> use-host-decl-names on;
> default-lease-time 300; #5 min
> max-lease-time 300; #5min
> log-facility local7;
>
>
>
> # static assignment
> #
> host node1 {
>   hardware ethernet 08:00:27:0A:C3:1C;
>   fixed-address 10.4.1.11;
>   ddns-hostname "node1";
> }
>
>
> Can anyone help to see what's missing from my configuration?
>
> Thanks.
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on DHCP lease expiration

David Li
In reply to this post by David Li
I see!
Do you have any suggestions to get around this? I do need to remove
the assignment from the DNS
if the host failed so others won't bother to contact the failed host.
Of course I can let the application to deal with the
timeout but still prefer to resolving this at DHCP/DNS level. It just
seems logical and convenient.

Maybe another related question is if I have to use static lease to map
host MAC to a name to assign the IP. I need to assign meaningful names
to our hosts in order for others to use them. That means the name
assignment has to be based on what kind of application this host runs.
I haven't found other dynamic ways to do this yet. Any suggestions?


David

> Date: Fri, 26 Feb 2016 17:46:04 -0800
> From: Shawn Routhier <[hidden email]>
> To: Users of ISC DHCP <[hidden email]>
> Subject: Re: Question on DHCP lease expiration
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=utf-8
>
> The server treats dynamic and static leases differently.
>
> Dynamic leases have a lease structure that moves between
> different queues and this is how the server knows when to
> expire the lease and thence when to remove it from the DNS.
>
> Static leases don?t have a lease structure and so don?t get
> expired and don?t get removed from the DNS.
>
> regards,
> Shawn
>
>> On Feb 26, 2016, at 5:37 PM, David Li <[hidden email]> wrote:
>>
>> Hi,
>>
>> This is my first post here.
>>
>> I am testing to see if an expired DHCP lease can result in the removal
>> of the corresponding DNS record on Centos 7.
>>
>> So far I am able to let DHCP server assign an static IP based on the
>> host's MAC address and add a DNS A record. The host is also able to
>> refresh its lease every time it expires.
>>
>> But when I shut down the host, I don't see the record removed after
>> the lease expired (5 min). Even more the syslog doesn't show any
>> messages from DHCP server attempting to remove the IP address and
>> update the BIND 9 (named) server. So I am thinking there might be
>> something wrong or missing in my dhcpd.conf.
>>
>> Here is a snippet of my dhcpd.conf:
>>
>>
>> # DNS options
>>
>> ddns-updates on;
>> ddns-update-style interim;
>> update-static-leases on;
>> authoritative;
>>
>> allow unknown-clients;
>> use-host-decl-names on;
>> default-lease-time 300; #5 min
>> max-lease-time 300; #5min
>> log-facility local7;
>>
>>
>>
>> # static assignment
>> #
>> host node1 {
>>   hardware ethernet 08:00:27:0A:C3:1C;
>>   fixed-address 10.4.1.11;
>>   ddns-hostname "node1";
>> }
>>
>>
>> Can anyone help to see what's missing from my configuration?
>>
>> Thanks.
>
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on DHCP lease expiration

Patrick Trapp
There was a similar thread to this on this list over the last few days. I believe reserved addresses were suggested rather than static, but you will probably benefit from looking at the archive from the last week to see if that OP was truly looking at the same situation as you.

> On Feb 27, 2016, at 11:42 AM, David Li <[hidden email]> wrote:
>
> I see!
> Do you have any suggestions to get around this? I do need to remove
> the assignment from the DNS
> if the host failed so others won't bother to contact the failed host.
> Of course I can let the application to deal with the
> timeout but still prefer to resolving this at DHCP/DNS level. It just
> seems logical and convenient.
>
> Maybe another related question is if I have to use static lease to map
> host MAC to a name to assign the IP. I need to assign meaningful names
> to our hosts in order for others to use them. That means the name
> assignment has to be based on what kind of application this host runs.
> I haven't found other dynamic ways to do this yet. Any suggestions?
>
>
> David
>
>> Date: Fri, 26 Feb 2016 17:46:04 -0800
>> From: Shawn Routhier <[hidden email]>
>> To: Users of ISC DHCP <[hidden email]>
>> Subject: Re: Question on DHCP lease expiration
>> Message-ID: <[hidden email]>
>> Content-Type: text/plain; charset=utf-8
>>
>> The server treats dynamic and static leases differently.
>>
>> Dynamic leases have a lease structure that moves between
>> different queues and this is how the server knows when to
>> expire the lease and thence when to remove it from the DNS.
>>
>> Static leases don?t have a lease structure and so don?t get
>> expired and don?t get removed from the DNS.
>>
>> regards,
>> Shawn
>>
>>> On Feb 26, 2016, at 5:37 PM, David Li <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> This is my first post here.
>>>
>>> I am testing to see if an expired DHCP lease can result in the removal
>>> of the corresponding DNS record on Centos 7.
>>>
>>> So far I am able to let DHCP server assign an static IP based on the
>>> host's MAC address and add a DNS A record. The host is also able to
>>> refresh its lease every time it expires.
>>>
>>> But when I shut down the host, I don't see the record removed after
>>> the lease expired (5 min). Even more the syslog doesn't show any
>>> messages from DHCP server attempting to remove the IP address and
>>> update the BIND 9 (named) server. So I am thinking there might be
>>> something wrong or missing in my dhcpd.conf.
>>>
>>> Here is a snippet of my dhcpd.conf:
>>>
>>>
>>> # DNS options
>>>
>>> ddns-updates on;
>>> ddns-update-style interim;
>>> update-static-leases on;
>>> authoritative;
>>>
>>> allow unknown-clients;
>>> use-host-decl-names on;
>>> default-lease-time 300; #5 min
>>> max-lease-time 300; #5min
>>> log-facility local7;
>>>
>>>
>>>
>>> # static assignment
>>> #
>>> host node1 {
>>>  hardware ethernet 08:00:27:0A:C3:1C;
>>>  fixed-address 10.4.1.11;
>>>  ddns-hostname "node1";
>>> }
>>>
>>>
>>> Can anyone help to see what's missing from my configuration?
>>>
>>> Thanks.
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on DHCP lease expiration

Simon Hobson
Patrick Trapp <[hidden email]> wrote:

> There was a similar thread to this on this list over the last few days. I believe reserved addresses were suggested rather than static, but you will probably benefit from looking at the archive from the last week to see if that OP was truly looking at the same situation as you.

It was a different requirement in that thread - but it's worth reading anyway.

For the OP, it sounds like reserved leases would indeed be the right tool. The only issue that might crop up is that while static assignments can use the MAC address only, reserved leases will use the Client-ID if provided - in the same way that normal leases are handled.

For all normal leases, the primary key for identifying the client is the Client ID if provided, and the MAC address only if no Client ID is provided.

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on DHCP lease expiration

glenn.satchell
In reply to this post by Patrick Trapp
Sounds like you just need normal dynamic leases. these will expire when
the client doesn't renew any more. You can add a host clause to set the
hostname, "option hostname foo.example.org;" or similar that will carry
through to the dns system. Just leave out the fixed-address statement.

Even though it is a 'random' address, if you only use the DNS name to
access the system then it doesn't matter what the IP address is.

regards,
-glenn

On Sun, February 28, 2016 6:47 am, Patrick Trapp wrote:

> There was a similar thread to this on this list over the last few days. I
> believe reserved addresses were suggested rather than static, but you will
> probably benefit from looking at the archive from the last week to see if
> that OP was truly looking at the same situation as you.
>
>> On Feb 27, 2016, at 11:42 AM, David Li <[hidden email]> wrote:
>>
>> I see!
>> Do you have any suggestions to get around this? I do need to remove
>> the assignment from the DNS
>> if the host failed so others won't bother to contact the failed host.
>> Of course I can let the application to deal with the
>> timeout but still prefer to resolving this at DHCP/DNS level. It just
>> seems logical and convenient.
>>
>> Maybe another related question is if I have to use static lease to map
>> host MAC to a name to assign the IP. I need to assign meaningful names
>> to our hosts in order for others to use them. That means the name
>> assignment has to be based on what kind of application this host runs.
>> I haven't found other dynamic ways to do this yet. Any suggestions?
>>
>>
>> David
>>
>>> Date: Fri, 26 Feb 2016 17:46:04 -0800
>>> From: Shawn Routhier <[hidden email]>
>>> To: Users of ISC DHCP <[hidden email]>
>>> Subject: Re: Question on DHCP lease expiration
>>> Message-ID: <[hidden email]>
>>> Content-Type: text/plain; charset=utf-8
>>>
>>> The server treats dynamic and static leases differently.
>>>
>>> Dynamic leases have a lease structure that moves between
>>> different queues and this is how the server knows when to
>>> expire the lease and thence when to remove it from the DNS.
>>>
>>> Static leases don?t have a lease structure and so don?t get
>>> expired and don?t get removed from the DNS.
>>>
>>> regards,
>>> Shawn
>>>
>>>> On Feb 26, 2016, at 5:37 PM, David Li <[hidden email]> wrote:
>>>>
>>>> Hi,
>>>>
>>>> This is my first post here.
>>>>
>>>> I am testing to see if an expired DHCP lease can result in the removal
>>>> of the corresponding DNS record on Centos 7.
>>>>
>>>> So far I am able to let DHCP server assign an static IP based on the
>>>> host's MAC address and add a DNS A record. The host is also able to
>>>> refresh its lease every time it expires.
>>>>
>>>> But when I shut down the host, I don't see the record removed after
>>>> the lease expired (5 min). Even more the syslog doesn't show any
>>>> messages from DHCP server attempting to remove the IP address and
>>>> update the BIND 9 (named) server. So I am thinking there might be
>>>> something wrong or missing in my dhcpd.conf.
>>>>
>>>> Here is a snippet of my dhcpd.conf:
>>>>
>>>>
>>>> # DNS options
>>>>
>>>> ddns-updates on;
>>>> ddns-update-style interim;
>>>> update-static-leases on;
>>>> authoritative;
>>>>
>>>> allow unknown-clients;
>>>> use-host-decl-names on;
>>>> default-lease-time 300; #5 min
>>>> max-lease-time 300; #5min
>>>> log-facility local7;
>>>>
>>>>
>>>>
>>>> # static assignment
>>>> #
>>>> host node1 {
>>>>  hardware ethernet 08:00:27:0A:C3:1C;
>>>>  fixed-address 10.4.1.11;
>>>>  ddns-hostname "node1";
>>>> }
>>>>
>>>>
>>>> Can anyone help to see what's missing from my configuration?
>>>>
>>>> Thanks.
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
>


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users