![]() |
![]()
| ![]() |
![]()
NAME
SYNOPSIS
DESCRIPTIONThe
The syntax of each line is exactly as specified in hosts(5)-like, but the jail's hostname follows a particular syntax: “<Jail Name>.<Virtual Network>HOST_DOMAIN”. The virtual network host name syntax is “<Virtual Network>HOST_DOMAIN”. See appjail.conf(5) for a description of the HOST_DOMAIN parameter, but as you can see, it is used exactly as is, assuming it is prefixed with a dot. This document also explains how to use the
rc(8)
script to implement The
rc(8)
script checks the current
hosts(5)-like
(appjail_dns_hosts:
/var/tmp/appjail-hosts) file against the output of
A hook is simply an external program that has two responsibilities: filtering the hosts(5)-like file and restarting the DNS server. These responsibilities depend entirely on the DNS server, as it may not need to be restarted, or even the hook may not need to modify the hosts(5)-like file for the DNS server to interpret it correctly. For example, if we use the following file for DNSMasq: /usr/local/share/appjail/files/dnsmasq.conf: addn-hosts=/var/tmp/appjail-hosts no-resolv server=208.67.222.222 server=208.67.220.220 With the necessary parameters in our rc.conf(5): dnsmasq_enable="YES" dnsmasq_conf="/usr/local/share/appjail/files/dnsmasq.conf" We are configuring DNSMasq to use /var/tmp/appjail-hosts as our hosts(5). Since it can perfectly interpret a hosts(5) file, it is not necessary to modify it. The hosts(5)-like file is passed to the hook as the first argument, but we don't need it, since the only thing our hook needs to do is restart DNSMasq. /usr/local/share/appjail/scripts/dnsmasq-hook.sh: #!/bin/sh service dnsmasq reload AppJail uses the above hook in its rc(8) script, but you can change to any other hook by changing the value of the appjail_dns_hook parameter in your rc.conf(5): appjail_dns_enable="YES" appjail_dns_hook="/usr/local/share/appjail/scripts/dnsmasq-hook.sh" Once everything is done, we can start the rc(8) scripts: # Since every time the
rc(8)
script is restarted, it checks if there are any changes between the output
of #
In my case, I have enabled SHORTEN_DOMAIN_NAMES, so a shorter domain name is available in that file, as you can see. EXIT STATUSThe SEE ALSOAUTHORSJesús Daniel Colmenares Oviedo <DtxdF@disroot.org>
|