📄 dhcpd.conf.5
字号:
"fs.sneedville.edu", and the client claims its hostname is "fs", noDNS update will be done for that client, and an error message will belogged..PPIf the A record update succeeds, a PTR record update for the assignedIP address will be done, pointing to the A record. This update isunconditional - it will be done even if another PTR record of the samename exists. Since the IP address has been assigned to the DHCPserver, this should be safe..PPPlease note that the current implementation assumes clients only havea single network interface. A client with two network interfaceswill see unpredictable behavior. This is considered a bug, and willbe fixed in a later release. It may be helpful to enable the.I one-lease-per-clientparameter so that roaming clients do not trigger this same behavior..PPThe DHCP protocol normally involves a four-packet exchange - first theclient sends a DHCPDISCOVER message, then the server sends aDHCPOFFER, then the client sends a DHCPREQUEST, then the server sendsa DHCPACK. In the current version of the server, the server will doa DNS update after it has received the DHCPREQUEST, and before it hassent the DHCPACK. It only sends the DNS update if it has not sentone for the client's address before, in order to minimize the impacton the DHCP server..PPWhen the client's lease expires, the DHCP server (if it is operatingat the time, or when next it operates) will remove the client's A andPTR records from the DNS database. If the client releases its leaseby sending a DHCPRELEASE message, the server will likewise remove theA and PTR records..SH THE INTERIM DNS UPDATE SCHEMEThe interim DNS update scheme operates mostly according to severaldrafts that are being considered by the IETF and are expected tobecome standards, but are not yet standards, and may not bestandardized exactly as currently proposed. These are:.PP.nf.ce 3draft-ietf-dhc-ddns-resolution-??.txtdraft-ietf-dhc-fqdn-option-??.txtdraft-ietf-dnsext-dhcid-rr-??.txt.fi.PPBecause our implementation is slightly different than the standard, wewill briefly document the operation of this update style here..PPThe first point to understand about this style of DNS update is thatunlike the ad-hoc style, the DHCP server does not necessarilyalways update both the A and the PTR records. The FQDN optionincludes a flag which, when sent by the client, indicates that theclient wishes to update its own A record. In that case, the servercan be configured either to honor the client's intentions or ignorethem. This is done with the statement \fIallow client-updates;\fR orthe statement \fIignore client-updates;\fR. By default, clientupdates are allowed..PPIf the server is configured to allow client updates, then if theclient sends a fully-qualified domain name in the FQDN option, theserver will use that name the client sent in the FQDN option to updatethe PTR record. For example, let us say that the client is a visitorfrom the "radish.org" domain, whose hostname is "jschmoe". Theserver is for the "example.org" domain. The DHCP client indicates inthe FQDN option that its FQDN is "jschmoe.radish.org.". It alsoindicates that it wants to update its own A record. The DHCP servertherefore does not attempt to set up an A record for the client, butdoes set up a PTR record for the IP address that it assigns theclient, pointing at jschmoe.radish.org. Once the DHCP client has anIP address, it can update its own A record, assuming that the"radish.org" DNS server will allow it to do so..PPIf the server is configured not to allow client updates, or if theclient doesn't want to do its own update, the server will simplychoose a name for the client, possibly using the hostname supplied bythe client ("jschmoe" in the previous example). It will use its owndomain name for the client, just as in the ad-hoc update scheme.It will then update both the A and PTR record, using the name that itchose for the client. If the client sends a fully-qualified domainname in the fqdn option, the server uses only the leftmost part of thedomain name - in the example above, "jschmoe" instead of"jschmoe.radish.org"..PPThe other difference between the ad-hoc scheme and the interimscheme is that with the interim scheme, a method is used thatallows more than one DHCP server to update the DNS database withoutaccidentally deleting A records that shouldn't be deleted nor failingto add A records that should be added. The scheme works as follows:.PPWhen the DHCP server issues a client a new lease, it creates a textstring that is an MD5 hash over the DHCP client's identification (seedraft-ietf-dnsext-dhcid-rr-??.txt for details). The update adds an Arecord with the name the server chose and a TXT record containing thehashed identifier string (hashid). If this update succeeds, theserver is done..PPIf the update fails because the A record already exists, then the DHCPserver attempts to add the A record with the prerequisite that theremust be a TXT record in the same name as the new A record, and thatTXT record's contents must be equal to hashid. If this updatesucceeds, then the client has its A record and PTR record. If itfails, then the name the client has been assigned (or requested) is inuse, and can't be used by the client. At this point the DHCP servergives up trying to do a DNS update for the client until the clientchooses a new name..PPThe interim DNS update scheme is called interim for two reasons.First, it does not quite follow the drafts. The current versions ofthe drafts call for a new DHCID RRtype, but this is not yetavailable. The interim DNS update scheme uses a TXT recordinstead. Also, the existing ddns-resolution draft calls for the DHCPserver to put a DHCID RR on the PTR record, but the \fIinterim\fRupdate method does not do this. It is our position that this is notuseful, and we are working with the author in hopes of removing itfrom the next version of the draft, or better understanding why it isconsidered useful..PPIn addition to these differences, the server also does not update veryaggressively. Because each DNS update involves a round trip to theDNS server, there is a cost associated with doing updates even if theydo not actually modify the DNS database. So the DHCP server trackswhether or not it has updated the record in the past (this informationis stored on the lease) and does not attempt to update records that itthinks it has already updated..PPThis can lead to cases where the DHCP server adds a record, and thenthe record is deleted through some other mechanism, but the servernever again updates the DNS because it thinks the data is alreadythere. In this case the data can be removed from the lease throughoperator intervention, and once this has been done, the DNS will beupdated the next time the client renews..SH DYNAMIC DNS UPDATE SECURITY.PPWhen you set your DNS server up to allow updates from the DHCP server,you may be exposing it to unauthorized updates. To avoid this, youshould use TSIG signatures - a method of cryptographically signingupdates using a shared secret key. As long as you protect thesecrecy of this key, your updates should also be secure. Note,however, that the DHCP protocol itself provides no security, and thatclients can therefore provide information to the DHCP server which theDHCP server will then use in its updates, with the constraintsdescribed previously..PPThe DNS server must be configured to allow updates for any zone thatthe DHCP server will be updating. For example, let us say thatclients in the sneedville.edu domain will be assigned addresses on the10.10.17.0/24 subnet. In that case, you will need a key declarationfor the TSIG key you will be using, and also two zone declarations -one for the zone containing A records that will be updates and one forthe zone containing PTR records - for ISC BIND, something like this:.PP.nfkey DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; secret pRP5FapFoJ95JEL06sv4PQ==;};zone "example.org" { type master; file "example.org.db"; allow-update { key DHCP_UPDATER; };};zone "17.10.10.in-addr.arpa" { type master; file "10.10.17.db"; allow-update { key DHCP_UPDATER; };};.fi.PPYou will also have to configure your DHCP server to do updates tothese zones. To do so, you need to add something like this to yourdhcpd.conf file:.PP.nfkey DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; secret pRP5FapFoJ95JEL06sv4PQ==;};zone EXAMPLE.ORG. { primary 127.0.0.1; key DHCP_UPDATER;}zone 17.127.10.in-addr.arpa. { primary 127.0.0.1; key DHCP_UPDATER;}.fi.PPThe \fIprimary\fR statement specifies the IP address of the nameserver whose zone information is to be updated..PPNote that the zone declarations have to correspond to authorityrecords in your name server - in the above example, there must be anSOA record for "example.org." and for "17.10.10.in-addr.arpa.". Forexample, if there were a subdoman "foo.example.org" with no separateSOA, you could not write a zone declaration for "foo.example.org." Also keep in mind that zone names in your DHCP configuration should end in a"."; this is the preferred syntax. If you do not end your zone name in a".", the DHCP server will figure it out. Also note that in the DHCPconfiguration, zone names are not encapsulated in quotes where there are inthe DNS configuration..PPYou should choose your own secret key, of course. The ISC BIND 8 and9 distributions come with a program for generating secret keys calleddnssec-keygen. The version that comes with BIND 9 is likely to produce asubstantially more random key, so we recommend you use that one evenif you are not using BIND 9 as your DNS server. If you are using BIND 9'sdnssec-keygen, the above key would be created as follows:.PP.nf dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER.fi.PPIf you are using the BIND 8 dnskeygen program, the following command willgenerate a key as seen above:.PP.nf dnskeygen -H 128 -u -c -n DHCP_UPDATER.fi.PPYou may wish to enable logging of DNS updates on your DNS server.To do so, you might write a logging statement like the following:.PP.nflogging { channel update_debug { file "/var/log/update-debug.log"; severity debug 3; print-category yes; print-severity yes; print-time yes; }; channel security_info { file "/var/log/named-auth.info"; severity info; print-category yes; print-severity yes; print-time yes; }; category update { update_debug; }; category security { security_info; };};.fi.PPYou must create the /var/log/named-auth.info and/var/log/update-debug.log files before starting the name server. Formore information on configuring ISC BIND, consult the documentationthat accompanies it..SH REFERENCE: EVENTS.PPThere are three kinds of events that can happen regarding a lease, andit is possible to declare statements that occur when any of theseevents happen. These events are the commit event, when the serverhas made a commitment of a certain lease to a client, the releaseevent, when the client has released the server from its commitment,and the expiry event, when the commitment expires..PPTo declare a set of statements to execute when an event happens, youmust use the \fBon\fR statement, followed by the name of the event,followed by a series of statements to execute when the event happens,enclosed in braces. Events are used to implement DNSupdates, so you should not define your own event handlers if you areusing the built-in DNS update mechanism..PPThe built-in version of the DNS update mechanism is in a textstring towards the top of server/dhcpd.c. If you want to use eventsfor things other than DNS updates, and you also want DNS updates, youwill have to start out by copying this code into your dhcpd.conf fileand modifying it..SH REFERENCE: DECLARATIONS.PP.B The .I shared-network.B statement.PP.nf \fBshared-network\fR \fIname\fR \fB{\fR [ \fIparameters\fR ] [ \fIdeclarations\fR ] \fB}\fR.fi.PPThe \fIshared-network\fR statement is used to inform the DHCP serverthat some IP subnets actually share the same physical network. Anysubnets in a shared network should be declared within a\fIshared-network\fR statement. Parameters specified in the\fIshared-network\fR statement will be used when booting clients onthose subnets unless parameters provided at the subnet or host leveloverride them. If any subnet in a shared network has addressesavailable for dynamic allocation, those addresses are collected into acommon pool for that shared network and assigned to clients as needed.There is no way to distinguish on which subnet of a shared network aclient should boot..PP.I Nameshould be the name of the shared network. This name is used whenprinting debugging messages, so it should be descriptive for theshared network. The name may have the syntax of a valid domain name(although it will never be used as such), or it may be any arbitraryname, enclosed in quotes..PP.B The .I subnet.B statement.PP.nf \fBsubnet\fR \fIsubnet-number\fR \fBnetmask\fR \fInetmask\fR \fB{\fR [ \fIparameters\fR ] [ \fIdeclarations\fR ] \fB}\fR.fi.PPThe \fIsubnet\fR statement is used to provide dhcpd with enoughinformation to tell whether or not an IP address is on that subnet.It may also be used to provide subnet-specific parameters and tospecify what addresses may be dynamically allocated to clients bootingon that subnet. Such addresses are specified using the \fIrange\fRdeclaration..PPThe
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -