Feature #7388


Support -h <hostname> for ipadm DHCP

Added by C Fraire over 7 years ago. Updated over 6 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:
External Bug:


DHCP supports DHCP option 12 "This option specifies the name of the host", but the DHCP client does not send this option.

The name cannot be simply inferred from $(hostname), since there may be multiple interfaces. This issue is to add an option, -h <hostname>, to set an explicit option for an interface.

Related issues

Related to illumos gate - Bug #15491: libipadm: the comparison will always evaluate as 'true'ClosedToomas Soome

Actions #1

Updated by C Fraire over 7 years ago

The Windows DHCP/Active Directory DNS-compatible option is actually DCHP client option 81 for a Fully Qualified Domain Name with client options to request that the DNS server manage transient A RR and PTR RR for the lifetime of the lease.

Actions #2

Updated by C Fraire over 7 years ago

  • add options -h,--reqhost and -1,--primary flag to ipadm create-addr for DHCP, and add reqhost and primary properties for (show|set|reset)-addrprop.
  • add ncu ip-reqhost and ip-primary properties for NWAM DHCP.
  • send for Client Fully Qualified Domain Name (DHCP client option 81 or DHCPv6 option 39) the nodename if the interface is primary or the value of -h,--reqhost or ip-reqhost in order to request that a compatible DHCP server (such as ISC-DHCP or Microsoft Windows DHCP with Windows DNS Dynamic Update) add A/AAAA and PTR resource records for the life of a lease.
  • leave existing /etc/hostname.* handling for non-ipadm use to send DHCP client option 12 (Hostname), but also recognize -1,--primary (nodename); -h,--reqhost; or ip-reqhost if defined. (Hostname is sent if an FQDN cannot be determined from configuration).
  • add dhcpagent option to use RFC 3315-style client ID (IAID/DUID) for all DHCPv4.
  • update to allow to GET_TAG of ClientID from dhcpagent state machine to let dhcpinfo print a readable version of the system-managed IAID/DUID.
  • document defunct client option 89.
  • update man pages (including a note about onu).
Actions #3

Updated by C Fraire over 7 years ago

Most "active" properties for an (interface)address object (aobj) are homed in kernel data structures and accessed via ioctl (e.g., SIOCGLIFFLAGS for address flags or SIOCGLIFZONE for the zone of an interface).

A couple of aobj properties do not have an active home except in ipmgmt_aobjmap_t. E.g., am_linklocal, which is a Boolean used to track the address object created by ipadm -T addrconf in order to differentiate it from a related object possibly created later by DHCPv6 for stateful IPv6.

This case's new DHCP address property, reqhost, has an active state that is homed on what is likely a remote server—in that server's DHCP/DNS implementation. So ipmgmt_aobjmap_t is chosen as the home for a local cache of that remote state.

Actions #4

Updated by C Fraire over 6 years ago

A missing ns_name_pton2 (__ns_name_pton2) SUNWPrivate interface is added for this issue. The library function was originally added (but missed from the mapfile) with the following:

commit 9525b14bcdeb5b5f6f95ab27c2f48f18bd2ec829
Author: Rao Shoaib <>
Date: Wed Nov 11 08:45:41 2009 -0800

6289479 libresolv2 clean up and alignment with libbind.6.0

ns_name_pton2 is like the already-exposed, private ns_name_pton (and used by the latter), but the former adds an argument and side effect:

fills in *dstlen (if non-NULL)

Actions #5

Updated by C Fraire over 6 years ago

Instead of using /etc/defaultdomain, which was clarified as being NIS-only, the patch was changed to add an ADOPT_DOMAINNAME dhcpagent parameter to indicate whether the agent should use if necessary either a DNSdmain returned from the server or a resolv.conf domain to construct an FQDN from a PQDN hostname.

Actions #6

Updated by Electric Monk over 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit b31320a79e2054c6739b5229259dbf98f3afc547

commit  b31320a79e2054c6739b5229259dbf98f3afc547
Author: Chris Fraire <>
Date:   2017-09-12T12:42:21.000Z

    7388 Support -h <hostname> for ipadm DHCP
    8517 Add ipadm and nwam options to allow designating a DHCP address as the primary interface
    8518 Allow using system-generated IAID/DUID for all DHCPv4
    8519 Add ns_name_pton2 to libresolv2 mapfile
    Reviewed by: Dan McDonald <>
    Reviewed by: Toomas Soome <>
    Reviewed by: Peter Tribble <>
    Approved by: Gordon Ross <>

Actions #7

Updated by Electric Monk over 6 years ago

git commit 2ee1ed1ec5dfdf07d2c92db58b11f630de2a6e87

commit  2ee1ed1ec5dfdf07d2c92db58b11f630de2a6e87
Author: Dan McDonald <>
Date:   2017-09-12T23:41:10.000Z

    7388 Support -h <hostname> for ipadm DHCP (fix man lint)

Actions #8

Updated by Dan McDonald 10 months ago

  • Related to Bug #15491: libipadm: the comparison will always evaluate as 'true' added

Also available in: Atom PDF