netcd.conf File Format for netcd

Purpose

Defines parameters for the netcd daemon.

Description

The /etc/netcd.conf file is the default configuration file for the netcd daemon. This file is part of TCP/IP in Network Support Facilities.

To change the /etc/netcd.conf file, run the stopsrc -s netcd command and then the startsrc -s netcd command. The netcd.conf file specifies the map resolvers that are cached, and supplies parameters to the netcd daemon.

A template of the netcd.conf file is provided in the /usr/samples/tcpip directory.

Attention: Further installations can overwrite the /usr/samples/tcpip/netcd.conf file. You can copy this file to another location and use it as a template to create your customized netcd configuration.

If you do not use any configuration files, the netcd daemon proceeds with the default values indicated later in this section.

There are 4 types of declarations (a declaration or statement being a line starting with one of the keywords followed by parameters):
  • cache description declarations (keyword - cache)
  • security declarations (keywords - owner, group and home_dir)
  • log file declarations (keywords - log_file, log_rotate, and log_size)
  • additional declarations to control the netcd daemon (keywords - net_scan_frequency, local_scan_frequency, and socket_queue_size)

Syntax

The general syntax is a string of characters that follows one or more spaces or tabs that follow the keyword, as shown in the following example:
cache  <space><space><tab><tab>  dns <space><space>  local  <tab><tab>  foo

The syntax for each individual keyword is described in the following sections.

Cache description declarations

Syntax

cache <type_of_cache> <type_of_map> <hash_size> <cache_ttl>

0 to n cache declarations describe what is cached. If no such line is specified, the default line is cache all all 128 60.

The type_of_cache parameter can have the following values:
  • local - local resolver
  • dns - DNS resolver
  • nis - nis resolver
  • nisplus - nisplus resolver
  • yp - yellow pages services
  • ulm - other resolvers that you are using on your machine (if any)
  • all - local, dns, nis, nisplus, ulm, and yp for the type_of_cache parameter
  • a ulm name - the name of a specific resolver other than local, dns, nis, and nisplus that you installed
Any string other than local, dns, nis, nisplus, yp, ulm, and all is taken as a ulm name. You can declare up to 16 ulms.
The type_of_map parameter can have the following values:
  • hosts - hosts map type of the resolver
  • protocols - protocols map type of the resolver
  • services - services map type of the resolver
  • networks - networks map type of the resolver
  • netgroup - netgroup map type of the resolver
  • all - all map types applicable for the type_of_map parameter that you specified
  • a yp map name - the name of a yellow page service from the list passwd.byname, passwd.byuid, group.byname, group.bygid, netid.byname, and passwd.adjunct.byname
The map types supported for local, nis, nisplus and ulm resolutions are hosts, services, networks, protocols and netgroup. For the dns cache, hosts is the only map supported.

The maps supported for yp are passwd.byname, passwd.byuid, group.byname, group.bygid, netid.byname, and passwd.adjunct.byname.

The hash_size parameter specifies the number of lines for the cache (a cache is a hash table). The default value is 128.

The cache_ttl parameter specifies the length of time during which an entry is kept in the cache. Its unit is minute. The value of 0 is infinite; the default value is 60. The cache_ttl parameter is not taken into account for local caches. For dns, it is not suggested to specify a non-null value, because if you specify a non-null value, it overwrites the DNS time-to-live (TTL) sent back when DNS finds the entry. Otherwise, each entry is kept in the cache for the duration of the TTL that the DNS specifies.

Security declarations

The three following declarations allow the netcd daemon to run in the secure mode (for example, security against code execution because of stack overflow):

Item Description
owner <value> Specifies the owner of the netcd daemon during its execution. The default value is root.
group <value> Specifies the group owner of the netcd daemon during its execution. The default value is system.
home_dir <value> Specifies the working directory for the netcd daemon during its execution. The default value is /.

Log file declarations

Item Description
log_file <file> Specifies the name of the log file for the netcd daemon. The default value is /var/tmp/netcd.log.
log_rotate <number> Specifies the number of rotations for the log file. The default is no rotation, which is specified by not including a log_rotate declaration.
log_size <number> Specifies the size of the log file, in case of rotation, in KB.

Additional declarations

Item Description
net_scan_frequency <value> Specifies the scan frequency, in minutes, of the network cache for expired entries because of TTL. The default value is 1.
local_scan_frequency <value> Specifies the scan frequency, in minutes, of the local files for modified dates. When a local file (for example, /etc/hosts) is detected as modified, the corresponding local cache is reloaded with the content of the file. The default value is 1.
socket_queue_size <value> Specifies the size of the message queue for the socket that the netcd daemon uses to communicate with the requesting applications. This value indicates how many waiting requests the netcd daemon will accept. The default value is 256.

Examples

  1. To cache only local host resolutions with a hash table of 1024 lines, use the following cache declaration:
    cache   local   hosts   1024
  2. To cache all of the local resolutions with caches of 512 lines, use the following cache declaration:
    cache  local  all  512
  3. For all protocol resolutions with a hash table of 600 lines and with an expiration of 1 day, use the following cache declaration:
    cache  all  protocols   600  1440
  4. For a david ulm for all maps with a hash table of 128 lines and with an expiration of 1 hour by default, use the following cache declaration:
    cache david   all 128