7.1 Single Query Mode

The simplest way to use smapc utility is to invoke it with three arguments:

 
smapc url map key
url

The URL of the server to query (see smap url).

map

The map name.

key

The lookup key.

For example:

 
$ smapc unix:///var/run/smap/sockmap aliases root@domain.com
OK smith dmk <rev@another.domain>

You may simplify the invocation if you add the URL to your initialization file, i.e. to the file smapc reads at startup for its defaults. This file resides in your home directory and is named ‘.smapc’. Open this file with your favorite editor, and add the following line to it:

 
open unix:///var/run/smap/sockmap

Now, when invoked with two arguments, smapc will use this URL by default:

 
$ smapc unix:///var/run/smap/sockmap aliases root@domain.com
OK smith dmk <rev@another.domain>

See section Initialization File, for a detailed description of this file.