Files
lotherk b654bf74a2 docs: add The Makronix Guide and its four installed forms
One DocBook source in docs/guide produces the manual pages, one HTML
file, the PDF and an MCDE information library.  The guide follows the
structure of The NetBSD Guide, describes Makronix 0.99.10
(Camouflage), and has its own chapters for MCDE, the Information
Manager and the display.

The forms are installed by the release:

  /usr/share/doc/makronix/makronix-guide.html
  /usr/share/doc/makronix/makronix-guide.pdf
  /usr/share/doc/makronix/infolib/makronix.dti/   (base-sys-share)
  /usr/share/man/man7/makronix-guide*.7           (man-reference-man)
  /etc/dt/config/Xsession.d/0000makronix          (etc-sys-etc)
  /etc/dt/infolib/en_US.UTF-8/makronix.dti        (symlink)

The information library is built with MCDE's dtdocbook2infolib from a
small Lua writer for the CDE DocBook SGML dialect; tools/test-tools.sh
runs docs/guide/check.sh on the installed copies and proves that a
missing manual page falls red.
2026-11-15 21:21:49 +00:00

95 lines
3.8 KiB
XML

<!-- License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. -->
<chapter id="services">
<title>DNS, DHCP and NTP</title>
<para>Three small services make a network usable: something that answers
name lookups, something that hands out addresses, and something that keeps
the clock right. A desktop uses all three as a client; a machine that
serves a network runs the first two as a server.</para>
<sect1 id="services-dns">
<title>Name resolution</title>
<para>The resolver reads <filename>/etc/resolv.conf</filename>. It lists
the name servers in the order they are tried, and the domain that
short names belong to:</para>
<screen>search example.lan
nameserver 192.168.1.1
nameserver 9.9.9.9</screen>
<para><filename>/etc/nsswitch.conf</filename> decides where a lookup
goes first. Makronix's installer sets <literal>hosts: files mdnsd
dns</literal>, so the local file answers first, then the local network
names, then DNS. The local name
<replaceable>name</replaceable><filename>.local</filename> is answered
by <citerefentry><refentrytitle>mdnsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
<para>A machine that should answer DNS for a small network can run
<citerefentry><refentrytitle>unbound</refentrytitle><manvolnum>8</manvolnum></citerefentry>
as a caching resolver, or <citerefentry><refentrytitle>nsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
as an authoritative server. Both are packages; both have their own
documentation, and both should be reachable only from the network they
serve. The firewall chapter is the place to decide that.</para>
</sect1>
<sect1 id="services-dhcp">
<title>DHCP</title>
<para>A client runs <citerefentry><refentrytitle>dhcpcd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
and needs no configuration beyond <literal>dhcpcd=YES</literal>. A
server runs <citerefentry><refentrytitle>dhcpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
with a lease file and a subnet declaration:</para>
<screen># cat /etc/dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.199;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
default-lease-time 86400;
max-lease-time 604800;
}
# echo 'dhcpd=YES' &gt;&gt; /etc/rc.conf
# touch /var/db/dhcpd.leases
# /etc/rc.d/dhcpd start</screen>
<para>The interface that serves the network must have a fixed address in
the same subnet (<xref linkend="network-fixed"/>); a DHCP server with an
address from DHCP is a machine that cannot find itself. A machine that
should always get the same address can be pinned by its Ethernet
address:</para>
<screen>host printer {
hardware ethernet 00:11:22:33:44:55;
fixed-address 192.168.1.50;
}</screen>
</sect1>
<sect1 id="services-ntp">
<title>Time</title>
<para>A correct clock matters for TLS, for mail and for the logs of two
machines that are compared. <citerefentry><refentrytitle>ntpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
is the daemon; <filename>/etc/ntp.conf</filename> names the servers:</para>
<screen>server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
</screen>
<para>With <literal>ntpd=YES</literal>, the clock is corrected
continuously and slowly. A clock that is wrong by hours is set once by
hand before the daemon starts:</para>
<screen># date 202611151200
# /etc/rc.d/ntpd restart
$ ntpq -p</screen>
<para><command>ntpq -p</command> lists the servers, the stratum and the
offset. A server marked with an asterisk is the one the daemon is
following. If none of them answers, the network or the firewall is the
problem, not the clock.</para>
</sect1>
</chapter>