Go to main content

Installing Oracle® Solaris 11.3 Systems

Exit Print View

Updated: April 2019
 
 

Example System Configuration Profiles

The examples in this section are complete system configuration profiles that can be added to an install service using the installadm create-profile command. Portions of these samples can be pieced together as needed. The following sample system configuration profiles are included in /usr/share/auto_install/sc_profiles:

  • enable_sci.xml - starts the system configuration interactive tool during the boot process.

  • sc_sample.xml - shows how to configure a user account, root role, console terminal type, keyboard, locale, timezone, and a single IPv4 network interface. See

  • static_network.xml - same as sc_sample.xml, except the network configuration is using profile template variables to use the network configuration from the netbooted AI client. Also this profile includes an example of configuring a naming service.

  • unconfig.xml - unconfigures the AI client during the boot process.

  • install_env/dns.xml - partial profile that includes configuration information to configure a DNS client.

  • install_env/network.xml - partial profile that includes configuration information for a static IP address and an InfiniBand datalink with static IP.

Sample System Configuration Profile

This section shows a sample system configuration profile that you might want to use as a base to modify. This sample is available at /usr/share/auto_install/sc_profiles/sc_sample.xml. After you have created an install service, this sample profile is available at image-path/auto_install/sc_profiles/sc_sample.xml.

<?xml version="1.0"?>
<!--
Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
-->

<!--
Sample system configuration profile for use with Automated Installer

Configures the following:
* User account name 'jack', password 'jack', GID 10, UID 101, root role, bash shell
* 'root' role with password 'solaris'
* Keyboard mappings set to US-English
* Time zone set to UTC
* Network configuration is automated with Network Auto-magic
* DNS name service client is enabled
 
See the installadm(8) man page for usage of 'create-profile' subcommand.
-->

<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="system configuration">
    <service name="system/config-user" version="1">
      <instance name="default" enabled="true">
        <property_group name="user_account">
          <propval name="login" value="jack"/>
          <propval name="password" value="9Nd/cwBcNWFZg"/>
          <propval name="description" value="default_user"/>
          <propval name="shell" value="/usr/bin/bash"/>
          <propval name="gid" value="10"/>
          <propval name="uid" value="101"/>
          <propval name="type" value="normal"/>
          <propval name="roles" value="root"/>
          <propval name="profiles" value="System Administrator"/>
        </property_group>
        <property_group name="root_account">
            <propval name="password" value="encrypted_password"/>
            <propval name="type" value="role"/>
        </property_group>
      </instance>
    </service>

    <service version="1" name="system/identity">
      <instance enabled="true" name="node">
        <property_group name="config">
           <propval name="nodename" value="solaris"/>
        </property_group>
      </instance>
    </service>

    <service name="system/console-login" version="1">
      <instance name="default" enabled="true">
        <property_group name="ttymon">
          <propval name="terminal_type" value="sun"/>
        </property_group>
      </instance>
    </service>

    <service name="system/keymap" version="1">
      <instance name="default" enabled="true">
        <property_group name="keymap">
          <propval name="layout" value="US-English"/>
        </property_group>
      </instance>
    </service>

    <service name="system/timezone" version="1">
      <instance name="default" enabled="true">
        <property_group name="timezone">
          <propval name="localtime" value="UTC"/>
        </property_group>
      </instance>
    </service>

    <service name="system/environment" version="1">
      <instance name="init" enabled="true">
        <property_group name="environment">
          <propval name="LANG" value="en_US.UTF-8"/>
        </property_group>
      </instance>
    </service>

    <service name="network/nstall" version="1">
      <instance name="default" enabled="true">
          <property_group name="install_ipv4_interface" type="application">
            <propval name="name" type="astring" value="{{AI_NETLINK_VANITY}}/v4"/>
            <propval name="address_type" type="astring" value="dhcp"/>
          </property_group>
      </instance>
    </service>
</service_bundle>

Specifying Static Network Configuration

    A version of this sample profile is available at /usr/share/auto_install/sc_profiles/static_network.xml. The version of this profile that is shown below is modified to configure the following parameters:

  • bge0 with IPv4 static address 203.0.113.10 and netmask 255.255.255.224

  • 203.0.113.1 IPv4 default route

  • bge1 with IPv6 addrconf address type

  • DNS 8.8.8.8 nameserver

  • example1.com and example2.com as DNS search list for host name lookup

The netmask is specified with the notation IPaddress/netmask, where netmask is a number that specifies the number of high-order bits of the netmask.

Value of netmask
Netmask Example
8
255.0.0.0
16
255.255.0.0
24
255.255.255.0
<?xml version="1.0"?>
<!--
Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
-->

<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="system configuration">
    <service name="system/config-user" version="1">
      <instance name="default" enabled="true">
        <property_group name="user_account">
          <propval name="login" value="jack"/>
          <propval name="password" value="9Nd/cwBcNWFZg"/>
          <propval name="description" value="default_user"/>
          <propval name="shell" value="/usr/bin/bash"/>
          <propval name="gid" value="10"/>
          <propval name="type" value="normal"/>
          <propval name="roles" value="root"/>
          <propval name="profiles" value="System Administrator"/>
        </property_group>
        <property_group name="root_account">
            <propval name="password" value="$5$dnRfcZse$Hx4aBQ161Uvn9ZxJFKMdRiy8tCf4gMT2s2rtkFba2y4"/>
            <propval name="type" value="role"/>
        </property_group>
      </instance>
    </service>

    <service version="1" name="system/identity">
      <instance enabled="true" name="node">
        <property_group name="config">
           <propval name="nodename" value="solaris"/>
        </property_group>
      </instance>
    </service>

    <service name="system/console-login" version="1">
      <instance name="default" enabled="true">
        <property_group name="ttymon">
          <propval name="terminal_type" value="sun"/>
        </property_group>
      </instance>
    </service>

    <service name="system/keymap" version="1">
      <instance name="default" enabled="true">
        <property_group name="keymap">
          <propval name="layout" value="US-English"/>
        </property_group>
      </instance>
    </service>

    <service name="system/timezone" version="1">
      <instance name="default" enabled="true">
        <property_group name="timezone">
          <propval name="localtime" value="UTC"/>
        </property_group>
      </instance>
    </service>

    <service name="system/environment" version="1">
      <instance name="init" enabled="true">
        <property_group name="environment">
          <propval name="LANG" value="en_US.UTF-8"/>
        </property_group>
      </instance>
    </service>

    <service name="network/physical" version="1">
        <instance name="default" enabled="true">
          <property_group name="install_ipv4_interface" type="application">
            <propval name="name" type="astring" value="{{AI_NETLINK_VANITY}}/v4"/>
            <propval name="address_type" type="astring" value="static"/>
            <propval name="static_address" type="net_address_v4" value="{{AI_IPV4}}/{{AI_IPV4_PREFIXLEN}}"/>
            <propval name="default_route" type="net_address_v4" value="{{AI_ROUTER}}"/>
          </property_group>
        </instance>
    </service>

    <service name="network/install" version="1" type="service">
        <instance name="default" enabled="true">
            <property_group name="install_ipv4_interface" type="application">
                <propval name="name" type="astring" value="bge0/v4"/>
                <propval name="address_type" type="astring" value="static"/>
                <propval name="static_address" type="net_address_v4" value="203.0.113.10/27"/>
                <propval name="default_route" type="net_address_v4" value="203.0.113.1"/>
            </property_group>

            <property_group name="install_ipv6_interface" type="application">
                <propval name="name" type="astring" value="bge1/v6"/>
                <propval name="address_type" type="astring" value="addrconf"/>
                <propval name="stateless" type="astring" value="yes"/>
                <propval name="stateful" type="astring" value="yes"/>
            </property_group>
        </instance>
    </service>

    <service name="network/dns/client" version="1">
        <property_group name="config">
            <property name="nameserver">
                <net_address_list>
                    <value_node value="8.8.8.8"/>
                </net_address_list>
            </property>
            <property name="search">
                <astring_list>
                    <value_node value="example1.com example2.com"/>
                </astring_list>
            </property>
        </property_group>
        <instance name="default" enabled="true"/>
    </service>

    <service version="1" name="system/name-service/switch">
        <property_group name="config">
            <propval name="default" value="files"/>
            <propval name="host" value="files dns mdns"/>
            <propval name="printer" value="user files"/>
        </property_group>
        <instance enabled="true" name="default"/>
    </service>

    <service version="1" name="system/name-service/cache">
        <instance enabled="true" name="default"/>
    </service>
</service_bundle>

Specifying an IB Link in a System Configuration Profile

The following example shows how to define an Infiniband (IB) link in a system configuration profile.

<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="system configuration">

    <service name="network/physical" version="1">
        <instance name="default" enabled="true">
            <property_group name="netcfg" type="application">
                <propval name="active_ncp" type="astring" value="DefaultFixed"/>
            </property_group>
        </instance>
    </service>

    <service name="network/install" version="1" type="service">
        <instance name="default" enabled="true">

            <property_group name="net5_partlink" type="ib_partlink">
               <propval name="name" type="astring" value="FFFF.net5"/>
               <propval name="link" type="astring" value="net5"/>
               <propval name="pkey" type="astring" value="FFFF"/>
            </property_group>

            <property_group name="FFFF_net5_ipv4" type="ipv4_interface">
                <propval name="name" type="astring" value="FFFF.net5/v4"/>
                <propval name="address_type" type="astring" value="static"/>
                <propval name="static_address" type="net_address_v4" value="203.0.113.49/27"/>

            <property_group name="net0_ipv4" type="ipv4_interface">
                <propval name="name" type="astring" value="net0/v4"/>
                <propval name="address_type" type="astring" value="static"/>
                <propval name="static_address" type="net_address_v4" value="203.0.113.49/27"/>
                <propval name="default_route" type="net_address_v4" value="203.0.113.32"/>
            </property_group>

        </instance>
    </service>

    <service name="network/dns/client" version="1">
        <property_group name="config">
            <property name="nameserver">
                <net_address_list>
                    <value_node value="192.0.2.35"/>
                    <value_node value="198.51.100.0/27"/>
                    <value_node value="198.51.100.32/27"/>
                </net_address_list>
            </property>
            <property name="search">
                <astring_list>
                    <value_node value="example.com"/>
                </astring_list>
            </property>
        </property_group>
        <instance name="default" enabled="true"/>
    </service>

    <service version="1" name="system/name-service/switch">
        <instance enabled="true" name="default"/>
        <property_group name="config">
            <propval name="default" value="files"/>
            <propval name="host" value="files dns mdns"/>
        </property_group>
    </service>

    <service version="1" name="system/name-service/cache">
        <instance enabled="true" name="default"/>
    </service>

Configuring Multiple IPv4 Interfaces

This example uses the ipv4_interface property group type which allows for multiple interfaces to be configured. You can also use the ipv6_interface property group type.

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
    <service_bundle type="profile" name="sysconfig">
        <service version="1" type="service" name="network/install">
            <instance enabled="true" name="default">
                <property_group name="install_ipv4_interface_0" type="ipv4_interface">
                    <propval type="net_address_v4" name="static_address" value="203.0.113.10/27"/>
                    <propval type="astring" name="name" value="net0/v4"/>
                    <propval type="astring" name="address_type" value="static"/>
                </property_group>
                <property_group name="install_ipv4_interface_1" type="ipv4_interface">
                    <propval type="net_address_v4" name="static_address" value="203.0.113.11/27"/>
                    <propval type="astring" name="name" value="net1/v4"/>
                    <propval type="astring" name="address_type" value="static"/>
                </property_group>
            </instance>
         </service>
     </service_bundle>
      <service name="network/install" version="1" type="service">
        <instance name="default" enabled="true">
            <property_group name="install_ipv4_interface" type="application">
                <propval name="name" type="astring" value="bge0/v4"/>
                <propval name="address_type" type="astring" value="static"/>
                <propval name="static_address" type="net_address_v4" value="203.0.113.10/27"/>
                <propval name="default_route" type="net_address_v4" value="203.0.113.1"/>
            </property_group>

Adding User SSH Keys

This example shows how to use the ssh_public_keys to add ssh keys for a user during an automated install session. Each key will be added to the $HOME/.ssh/authorized_keys for the named user.

    <property_group type="application" name="user_account">
            ...
      <property type="astring" name="ssh_public_keys">
        <astring_list>
          <value_node value='[<options>] <key-type> <base64-encoding-key> [<comment>]' />
          <value_node value='[<options>] <key-type> <base64-encoding-key> [<comment>]' />
        </astring_list>
      </property>
    </property_group>
  

Specifying Name Service Configuration

You can use the sample profiles in this section as templates to create your own profiles, or you can use the sysconfig tool with the naming_services grouping to produce a profile based on your responses to prompts. See Creating a System Configuration Profile Using the SCI Tool and the sysconfig(1M) man page for more information about using sysconfig to create a system configuration profile.

Configuring Name Service NIS

Example 80  Enabling NIS For a Specified Domain

    This example profile performs the following configuration:

  • Enables NIS for example.domain.com

  • Uses broadcasting to discover the NIS server, which must be on the same subnet

  • Enables the name service cache service, which is required

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 -->
<service_bundle type='profile' name='default'>
    <service name='network/nis/domain' type='service' version='1'>
      <property_group name='config' type='application'>
          <propval name='domainname' type='hostname' value='example.domain.com'/>
      </property_group>
      <instance name='default' enabled='true' />
    </service>
    <service name='network/nis/client' type='service' version='1'>
      <property_group name='config' type='application'>
          <propval name='use_broadcast' type='boolean' value='true'/>
      </property_group>
      <instance name='default' enabled='true' />
    </service>
    <service name='system/name-service/switch' type='service' version='1'>
      <property_group name='config' type='application'>
          <propval name='default' type='astring' value='files nis'/>
          <propval name='printer' type='astring' value='user files nis'/>
          <propval name='netgroup' type='astring' value='nis'/>
      </property_group>
      <instance name='default' enabled='true' />
    </service>
    <service name='system/name-service/cache' type='service' version='1'>
      <instance name='default' enabled='true' />
    </service>
</service_bundle>
Example 81  Configuring NIS and Disabling DNS

    This example profile performs the following configuration:

  • Configures name service NIS with automatic broadcasting for a NIS server, which must be on the same subnet

  • Configures the NIS domain example.domain.com

  • Enables the name service cache service, which is required

  • Disables the DNS name service

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <!-- service name-service/switch below for NIS only - (see nsswitch.conf(5)) -->
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files nis"/>
      <propval type="astring" name="printer" value="user files nis"/>
      <propval type="astring" name="netgroup" value="nis"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <!-- service name-service/cache must be present along with name-service/switch -->
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <!-- if no DNS, must be explicitly disabled to avoid error msgs -->
  <service version="1" type="service" name="network/dns/client">
    <instance enabled="false" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/domain">
    <property_group type="application" name="config">
      <propval type="hostname" name="domainname" value="example.domain.com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <!-- configure the NIS client service to broadcast the subnet for a NIS server -->
  <service version="1" type="service" name="network/nis/client">
    <property_group type="application" name="config">
      <propval type="boolean" name="use_broadcast" value="true"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>
Example 82  Configuring NIS

The following profile configures the NIS name service with a NIS server IP address of 203.0.113.10 and domain ofmydomain.com. The NIS server is not required to be on the same subnet when the NIS server IP address is explicitly specified.

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
    <!-- name-service/switch below for NIS only - (see nsswitch.conf(5)) -->
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files nis"/>
      <propval type="astring" name="printer" value="user files nis"/>
      <propval type="astring" name="netgroup" value="nis"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <!-- name-service/cache must be present along with name-service/switch -->
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <!-- if no DNS, must be explicitly disabled to avoid error msgs -->
  <service version="1" type="service" name="network/dns/client">
    <instance enabled="false" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/domain">
    <property_group type="application" name="config">
      <propval type="hostname" name="domainname" value="mydomain.com"/>
      <!-- Note: use property with net_address_list and value_node as below -->
      <property type="net_address" name="ypservers">
        <net_address_list>
          <value_node value="203.0.113.10"/>
        </net_address_list>
      </property>
    </property_group>
    <!-- configure default instance separate from property_group -->
    <instance enabled="true" name="default"/>
  </service>
  <!-- enable the NIS client service -->
  <service version="1" type="service" name="network/nis/client">
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>
Example 83  Enabling NIS and DNS For a Specified Domain

    This example configures both DNS and NIS name services:

  • Specifies multiple DNS name servers

  • Specifies a DNS domain search list

  • Specifies a NIS domain

  • Specifies broadcasting to discover the NIS server

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-->
<service_bundle type='profile' name='default'>
    <service name='network/dns/client' type='service' version='1'>
      <property_group name='config' type='application'>
        <propval name='domain' type='astring' value='us.oracle.com'/>
        <property name='nameserver' type='net_address'>
          <net_address_list>
            <value_node value='192.0.2.52/27' />
            <value_node value='192.0.2.41/27' />
            <value_node value='192.0.2.15/27' />
          </net_address_list>
       </property>
      <property name='search' type='astring'>
          <astring_list>
            <value_node value='us.oracle.com oracle.com oraclecorp.com' />
          </astring_list>
      </property>
      </property_group>
    <instance name='default' enabled='true' />
    </service>
    <service name='network/nis/domain' type='service' version='1'>
      <property_group name='config' type='application'>
          <propval name='domainname' type='hostname' value='mydomain.com'/>
      </property_group>
    <instance name='default' enabled='true' />
  /service>
    <service name='network/nis/client' type='service' version='1'>
      <property_group name='config' type='application'>
          <propval name='use_broadcast' type='boolean' value='true'/>
      </property_group>
      <instance name='default' enabled='true' />
    </service>
    <service name='system/name-service/switch' type='service' version='1'>
      <property_group name='config' type='application'>
          <propval name='default' type='astring' value='files nis'/>
           <propval name='host' type='astring' value='files dns'/>
          <propval name='printer' type='astring' value='user files nis'/>
          <propval name='netgroup' type='astring' value='nis'/>
      </property_group>
      <instance name='default' enabled='true' />
    </service>
    <service name='system/name-service/cache' type='service' version='1'>
      <instance name='default' enabled='true' />
    </service>
</service_bundle>

Configuring the DNS Name Service

Example 84  Configuring DNS With a Search List

    The following example profile configures the following parameters:

  • Name service: DNS

  • Server IP addresses: 192.0.2.1 and 198.51.100.1

  • Domain: example.domain.com

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <!-- name-service/switch below for DNS only - (see nsswitch.conf(5)) -->
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files"/>
      <propval type="astring" name="host" value="files dns"/>
      <propval type="astring" name="printer" value="user files"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <!-- name-service/cache must be present along with name-service/switch -->
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/dns/client">
    <property_group type="application" name="config">
      <!-- Note: use property with net_address_list and value_node as below -->
      <property type="net_address" name="nameserver">
        <net_address_list>
          <value_node value="192.0.2.1"/>
          <value_node value="198.51.100.1"/>
        </net_address_list>
      </property>
      <!-- Note: use property with astring_list and value_node,
           concatenating search names, as below -->
      <property type="astring" name="search">
        <astring_list>
          <value_node value="my.domin.com domain.com"/>
        </astring_list>
      </property>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>

Configuring Name Service LDAP

Example 85  Configuring LDAP and LDAP Search Base

    This example profile configures the following parameters:

  • DAP me server IP address: 203.0.113.10

  • Domain example.domain.com specified in service system/nis/domain

  • LDAP search base (required), dc=my,dc=domain,dc=com

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files ldap"/>
      <propval type="astring" name="printer" value="user files ldap"/>
      <propval type="astring" name="netgroup" value="ldap"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/dns/client">
    <instance enabled="false" name="default"/>
  </service>
  <service version="1" type="service" name="network/ldap/client">
    <property_group type="application" name="config">
      <propval type="astring" name="profile" value="default"/>
      <property type="host" name="server_list">
        <host_list>
          <value_node value="203.0.113.10"/>
        </host_list>
      </property>
      <propval type="astring" name="search_base" value="dc=my,dc=domain,dc=com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/domain">
    <property_group type="application" name="config">
      <propval type="hostname" name="domainname" value="example.domain.com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>
Example 86  Configuring LDAP With a Secure LDAP Server

    This example profile configures the following parameters:

  • AP server IP address: 203.0.113.10

  • Domain example.domain.com specified in service system/nis/domain

  • LDAP search base (required), dc=my,dc=domain,dc=com

  • LDAP proxy bind distinguished name cn=proxyagent,ou=profile,dc=my,dc=domain,dc=com

  • LDAP proxy bind password, encrypted as a security measure. You can find the encrypted value by using one of the following methods:

    • Take the bind_passwd property value from sysconfig create-profile.

    • Take the value from the SMF configuration on the LDAP server.

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files ldap"/>
      <propval type="astring" name="printer" value="user files ldap"/>
      <propval type="astring" name="netgroup" value="ldap"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/dns/client">
    <instance enabled="false" name="default"/>
  </service>
  <service version="1" type="service" name="network/ldap/client">
    <property_group type="application" name="config">
      <propval type="astring" name="profile" value="default"/>
      <property type="host" name="server_list">
        <host_list>
          <value_node value="203.0.113.10"/>
        </host_list>
      </property>
      <propval type="astring" name="search_base" value="dc=my,dc=domain,dc=com"/>
    </property_group>
    <property_group type="application" name="cred">
      <propval type="astring" name="bind_dn" value="cn=proxyagent,ou=profile,dc=my,dc=domain,dc=com"/>
      <!-- note that the password below is encrypted -->
      <propval type="astring" name="bind_passwd" value="{NS1}c2ab873ae7c5ceefa4b9"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/domain">
    <property_group type="application" name="config">
      <propval type="hostname" name="domainname" value="example.domain.com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>

Using DNS With LDAP

The DNS name service can be used in conjunction with the LDAP name service. A typical usage is for DNS to resolve node names (including the LDAP server name), and for LDAP to resolve all other names. The service system/name-service/switch is used to specify DNS for node name search and LDAP to resolve other names, as shown in the first service element in this example.

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files ldap"/>
      <propval type="astring" name="host" value="files dns"/>
      <propval type="astring" name="printer" value="user files ldap"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/dns/client">
    <property_group type="application" name="config">
      <property type="net_address" name="nameserver">
        <net_address_list>
          <value_node value="203.0.113.10"/>
        </net_address_list>
      </property>
      <propval type="astring" name="domain" value="example.domain.com"/>
      <property type="astring" name="search">
        <astring_list>
          <value_node value="example.domain.com"/>
        </astring_list>
      </property>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/ldap/client">
    <property_group type="application" name="config">
      <propval type="astring" name="profile" value="default"/>
      <property type="host" name="server_list">
        <host_list>
          <!-- here, DNS is expected to resolve the LDAP server by name -->
          <value_node value="ldapserver.example.domain.com"/>
        </host_list>
      </property>
      <propval type="astring" name="search_base" value="dc=my,dc=domain,dc=com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/domain">
    <property_group type="application" name="config">
      <propval type="hostname" name="domainname" value="example.domain.com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>

Using NIS With DNS

NIS can be used in conjunction with DNS in a similar way.

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files nis"/>
      <propval type="astring" name="host" value="files dns"/>
      <propval type="astring" name="printer" value="user files nis"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/dns/client">
    <property_group type="application" name="config">
      <property type="net_address" name="nameserver">
        <net_address_list>
          <value_node value="203.0.113.10"/>
        </net_address_list>
      </property>
      <propval type="astring" name="domain" value="example.domain.com"/>
      <property type="astring" name="search">
        <astring_list>
          <value_node value="example.domain.com"/>
        </astring_list>
      </property>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/domain">
    <property_group type="application" name="config">
      <propval type="hostname" name="domainname" value="example.domain.com"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/nis/client">
    <property_group type="application" name="config">
      <propval type="boolean" name="use_broadcast" value="true"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>