1 ## 6.10 Configuration Files
\r
2 ### 6.10.1 /etc Layout
\r
3 There are a number of directories in which configuration information is kept. These include:
\r
5 | `/etc` | Generic system configuration information; data here is system-specific.
6 `/etc/defaults` | Default versions of system configuration files.
7 `/etc/mail` | Extra [sendmail(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#sendmail§ion8) configuration, other MTA configuration files.
8 `/etc/ppp` | Configuration for both user- and kernel-ppp programs.
9 `/etc/namedb` | Default location for [named(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#named§ion8) data. Normally `named.conf` and zone files are stored here.
10 `/usr/local/etc` | Configuration files for installed applications. May contain per-application subdirectories.
11 `/usr/local/etc/rc.d` | Start/stop scripts for installed applications.
12 `/var/db` | Automatically generated system-specific database files, such as the package database, the locate database, and so on |
\r
15 ### 6.10.2 Hostnames
\r
16 #### 6.10.2.1 /etc/resolv.conf
\r
17 `/etc/resolv.conf` dictates how DragonFly's resolver accesses the Internet Domain Name System (DNS).
\r
19 The most common entries to `resolv.conf` are:
\r
21 | `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.
22 `search` | Search list for hostname lookup. This is normally determined by the domain of the local hostname.
23 `domain` | The local domain name. |
\r
26 A typical `resolv.conf`:
\r
30 nameserver 147.11.1.11
\r
31 nameserver 147.11.100.30
\r
33 **Note:** Only one of the `search` and `domain` options should be used.
\r
35 If you are using DHCP, [dhclient(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#dhclient§ion8) usually rewrites `resolv.conf` with information received from the DHCP server.
\r
37 #### 6.10.2.2 /etc/hosts
\r
38 `/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§ion8) 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.
\r
44 # This file should contain the addresses and aliases
\r
45 # for local hosts that share this file.
\r
46 # In the presence of the domain name service or NIS, this file may
\r
47 # not be consulted at all; see /etc/nsswitch.conf for the resolution order.
\r
50 ::1 localhost localhost.my.domain myname.my.domain
\r
51 127.0.0.1 localhost localhost.my.domain myname.my.domain
\r
53 # Imaginary network.
\r
54 #10.0.0.2 myname.my.domain myname
\r
55 #10.0.0.3 myfriend.my.domain myfriend
\r
57 # According to RFC 1918, you can use the following IP networks for
\r
58 # private nets which will never be connected to the Internet:
\r
60 # 10.0.0.0 - 10.255.255.255
\r
61 # 172.16.0.0 - 172.31.255.255
\r
62 # 192.168.0.0 - 192.168.255.255
\r
64 # In case you want to be able to connect to the Internet, you need
\r
65 # real official assigned numbers. PLEASE PLEASE PLEASE do not try
\r
66 # to invent your own network numbers but instead get one from your
\r
67 # network provider (if any) or from the Internet Registry (ftp to
\r
68 # rs.internic.net, directory `/templates').
\r
71 `/etc/hosts` takes on the simple format of:
\r
74 [Internet address] [official hostname] [alias1] [alias2] ...
\r
79 10.0.0.1 myRealHostname.example.com myRealHostname foobar1 foobar2
\r
81 Consult [hosts(5)](http://leaf.dragonflybsd.org/cgi/web-man?command#hosts§ion5) for more information.
\r
83 ### 6.10.3 Log File Configuration
\r
84 #### 6.10.3.1 syslog.conf
\r
85 `syslog.conf` is the configuration file for the [syslogd(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#syslogd§ion8) program. It indicates which types of `syslog` messages are logged to particular log files.
\r
90 # Spaces ARE valid field separators in this file. However,
\r
91 # other *nix-like systems still insist on using tabs as field
\r
92 # separators. If you are sharing this file between systems, you
\r
93 # may want to use only tabs as field separators here.
\r
94 # Consult the syslog.conf(5) manual page.
\r
96 *.err;kern.debug;auth.notice;mail.crit /dev/console
\r
97 *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
\r
99 security.* /var/log/security
\r
100 mail.info /var/log/maillog
\r
101 lpr.info /var/log/lpd-errs
\r
102 cron.* /var/log/cron
\r
105 *.notice;news.err root
\r
109 # uncomment this to log all writes to /dev/console to /var/log/console.log
\r
110 #console.info /var/log/console.log
\r
111 # uncomment this to enable logging of all log messages to /var/log/all.log
\r
112 #*.* /var/log/all.log
\r
113 # uncomment this to enable logging to a remote log host named loghost
\r
115 # uncomment these if you're running inn
\r
116 # news.crit /var/log/news/news.crit
\r
117 # news.err /var/log/news/news.err
\r
118 # news.notice /var/log/news/news.notice
\r
121 *.* /var/log/slip.log
\r
124 *.* /var/log/ppp.log
\r
126 Consult the [syslog.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command#syslog.conf§ion5) manual page for more information.
\r
128 #### 6.10.3.2 newsyslog.conf
\r
129 `newsyslog.conf` is the configuration file for [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#newsyslog§ion8), 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.
\r
131 `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.
\r
134 # configuration file for newsyslog
\r
137 # filename [owner:group] mode count size when [ZB] [/pid_file] [sig_num]
\r
138 /var/log/cron 600 3 100 * Z
\r
139 /var/log/amd.log 644 7 100 * Z
\r
140 /var/log/kerberos.log 644 7 100 * Z
\r
141 /var/log/lpd-errs 644 7 100 * Z
\r
142 /var/log/maillog 644 7 * @T00 Z
\r
143 /var/log/sendmail.st 644 10 * 168 B
\r
144 /var/log/messages 644 5 100 * Z
\r
145 /var/log/all.log 600 7 * @T00 Z
\r
146 /var/log/slip.log 600 3 100 * Z
\r
147 /var/log/ppp.log 600 3 100 * Z
\r
148 /var/log/security 600 10 100 * Z
\r
149 /var/log/wtmp 644 3 * @01T05 B
\r
150 /var/log/daily.log 640 7 * @T00 Z
\r
151 /var/log/weekly.log 640 5 1 $W6D0 Z
\r
152 /var/log/monthly.log 640 12 * $M1D0 Z
\r
153 /var/log/console.log 640 5 100 * Z
\r
155 Consult the [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#newsyslog§ion8) manual page for more information.
\r
157 ### 6.10.4 sysctl.conf
\r
158 `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.
\r
160 A sample `sysctl.conf` turning off logging of fatal signal exits and letting Linux programs know they are really running under DragonFly:
\r
163 kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11)
\r
164 compat.linux.osname=DragonFly
\r
165 compat.linux.osrelease=4.3-STABLE
\r