dhcpaction Command
Purpose
Provides a script that runs every time that a client updates its lease.
Syntax
/usr/sbin/dhcpaction HostName DomainName IPAddress LeaseTime ClientID { A | PTR | BOTH | NONE } { NONIM | NIM }
Description
The dhcpaction command
provides methods to update the DNS server by calling the nsupdate command
with the appropriate sequence of events to update the A
record, PTR
record,
or both. The dhcpaction command is called by the
DHCP client and server daemons. It is called from the updateDNS
string.
This setting is configurable because in some environments, mainly
heterogeneous ones, some clients might not be able to update the A
record
or the PTR
record. The default action is for the
client to update the A
record and the server to update
the PTR
record. The options might be set in the daemon
configuration files to allow for any policy that the network administrator
wants to implement.
The dhcpaction command
also runs NIM and DHCP concurrently. The dhcpaction command,
when provided with the NIM parameter, tries to issue updates to NIM
objects when their IP addresses change. This action keeps the objects
in sync. To do so, some pending operations might have to be canceled.
The objects are commented and a message is sent to the console of
the master machine. The objects must not be reset often. Addresses
must not commonly change in the DHCP environment. Only the clients
must set the NONIM
option.
Parameters
Item | Description |
---|---|
ClientID | Specifies the client ID to use when you update the DNS server. |
DomainName | Specifies the domain name to use when you update the DNS server. |
HostName | Specifies the host name to update in the DNS server. |
IPAddress | Specifies the IP address to associate with the host name in the DNS server. |
LeaseTime | Specifies the duration of the association between the host name and IP address in the DNS server in seconds. |
Options
Item | Description |
---|---|
A | PTR | BOTH | NONE | Specifies which record (if any) is to be updated in the DNS server. |
NONIM | NIM | Specifies whether the script must run to help NIM and DHCP interact correctly. It must be set only to NIM on DHCP servers. |
Exit Status
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
Security
Access Control: Any user, but might need to be root for some NIM actions.
Files
Item | Description |
---|---|
/usr/sbin/dhcpaction | Contains the dhcpaction command. |
/etc/dhcpcd.ini | Contains the DHCP client configuration file. |