1 ## 6.10 Configuration Files
5 There are a number of directories in which configuration information is kept. These include:
8 | `/etc` | Generic system configuration information; data here is system-specific.
9 `/etc/defaults` | Default versions of system configuration files.
10 `/etc/mail` | Extra [sendmail(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=sendmail§ion=8) configuration, other MTA configuration files.
11 `/etc/ppp` | Configuration for both user- and kernel-ppp programs.
12 `/etc/namedb` | Default location for [named(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=named§ion=8) data. Normally `named.conf` and zone files are stored here.
13 `/usr/local/etc` | Configuration files for installed applications. May contain per-application subdirectories.
14 `/usr/local/etc/rc.d` | Start/stop scripts for installed applications.
15 `/var/db` | Automatically generated system-specific database files, such as the package database, the locate database, and so on |
23 #### 6.10.2.1 /etc/resolv.conf
25 `/etc/resolv.conf` dictates how DragonFly's resolver accesses the Internet Domain Name System (DNS).
29 The most common entries to `resolv.conf` are:
32 | `nameserver` | The IP address of a name server the resolver should query. The servers are queried in the order listed with a maximum of three.
33 `search` | Search list for hostname lookup. This is normally determined by the domain of the local hostname.
34 `domain` | The local domain name. |
40 A typical `resolv.conf`:
48 nameserver 147.11.1.11
50 nameserver 147.11.100.30
54 **Note:** Only one of the `search` and `domain` options should be used.
58 If you are using DHCP, [dhclient(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=dhclient§ion=8) usually rewrites `resolv.conf` with information received from the DHCP server.
62 #### 6.10.2.2 /etc/hosts
64 `/etc/hosts` is a simple text database reminiscent of the old Internet. It works in conjunction with DNS and NIS providing name to IP address mappings. Local computers connected via a LAN can be placed in here for simplistic naming purposes instead of setting up a [named(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=named§ion=8) server. Additionally, `/etc/hosts` can be used to provide a local record of Internet names, reducing the need to query externally for commonly accessed names.
76 # This file should contain the addresses and aliases
78 # for local hosts that share this file.
80 # In the presence of the domain name service or NIS, this file may
82 # not be consulted at all; see /etc/nsswitch.conf for the resolution order.
88 ::1 localhost localhost.my.domain myname.my.domain
90 127.0.0.1 localhost localhost.my.domain myname.my.domain
96 #10.0.0.2 myname.my.domain myname
98 #10.0.0.3 myfriend.my.domain myfriend
102 # According to RFC 1918, you can use the following IP networks for
104 # private nets which will never be connected to the Internet:
108 # 10.0.0.0 - 10.255.255.255
110 # 172.16.0.0 - 172.31.255.255
112 # 192.168.0.0 - 192.168.255.255
116 # In case you want to be able to connect to the Internet, you need
118 # real official assigned numbers. PLEASE PLEASE PLEASE do not try
120 # to invent your own network numbers but instead get one from your
122 # network provider (if any) or from the Internet Registry (ftp to
124 # rs.internic.net, directory `/templates').
130 `/etc/hosts` takes on the simple format of:
136 [Internet address] [official hostname] [alias1] [alias2] ...
146 10.0.0.1 myRealHostname.example.com myRealHostname foobar1 foobar2
150 Consult [hosts(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=hosts§ion=5) for more information.
154 ### 6.10.3 Log File Configuration
156 #### 6.10.3.1 syslog.conf
158 `syslog.conf` is the configuration file for the [syslogd(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=syslogd§ion=8) program. It indicates which types of `syslog` messages are logged to particular log files.
168 # Spaces ARE valid field separators in this file. However,
170 # other *nix-like systems still insist on using tabs as field
172 # separators. If you are sharing this file between systems, you
174 # may want to use only tabs as field separators here.
176 # Consult the syslog.conf(5) manual page.
179 *.err;kern.debug;auth.notice;mail.crit /dev/console
181 *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
184 security.* /var/log/security
186 mail.info /var/log/maillog
188 lpr.info /var/log/lpd-errs
195 *.notice;news.err root
202 # uncomment this to log all writes to /dev/console to /var/log/console.log
204 #console.info /var/log/console.log
206 # uncomment this to enable logging of all log messages to /var/log/all.log
208 #*.* /var/log/all.log
210 # uncomment this to enable logging to a remote log host named loghost
214 # uncomment these if you're running inn
216 # news.crit /var/log/news/news.crit
218 # news.err /var/log/news/news.err
220 # news.notice /var/log/news/news.notice
225 *.* /var/log/slip.log
234 Consult the [syslog.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=syslog.conf§ion=5) manual page for more information.
238 #### 6.10.3.2 newsyslog.conf
240 `newsyslog.conf` is the configuration file for [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=newsyslog§ion=8), a program that is normally scheduled to run by [cron(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=cron§ion=8). [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=newsyslog§ion=8) determines when log files require archiving or rearranging. `logfile` is moved to `logfile.0`, `logfile.0` is moved to `logfile.1`, and so on. Alternatively, the log files may be archived in [gzip(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=gzip§ion=1) format causing them to be named: `logfile.0.gz`, `logfile.1.gz`, and so on.
244 `newsyslog.conf` indicates which log files are to be managed, how many are to be kept, and when they are to be touched. Log files can be rearranged and/or archived when they have either reached a certain size, or at a certain periodic time/date.
250 # configuration file for newsyslog
256 # filename [owner:group] mode count size when [ZB] [/pid_file] [sig_num]
258 /var/log/cron 600 3 100 * Z
260 /var/log/amd.log 644 7 100 * Z
262 /var/log/kerberos.log 644 7 100 * Z
264 /var/log/lpd-errs 644 7 100 * Z
266 /var/log/maillog 644 7 * @T00 Z
268 /var/log/sendmail.st 644 10 * 168 B
270 /var/log/messages 644 5 100 * Z
272 /var/log/all.log 600 7 * @T00 Z
274 /var/log/slip.log 600 3 100 * Z
276 /var/log/ppp.log 600 3 100 * Z
278 /var/log/security 600 10 100 * Z
280 /var/log/wtmp 644 3 * @01T05 B
282 /var/log/daily.log 640 7 * @T00 Z
284 /var/log/weekly.log 640 5 1 $W6D0 Z
286 /var/log/monthly.log 640 12 * $M1D0 Z
288 /var/log/console.log 640 5 100 * Z
292 Consult the [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=newsyslog§ion=8) manual page for more information.
296 ### 6.10.4 sysctl.conf
298 `sysctl.conf` looks much like `rc.conf`. Values are set in a `variable=value` form. The specified values are set after the system goes into multi-user mode. Not all variables are settable in this mode.
302 A sample `sysctl.conf` turning off logging of fatal signal exits and letting Linux programs know they are really running under DragonFly:
308 kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11)
310 compat.linux.osname=DragonFly
312 compat.linux.osrelease=4.3-STABLE