about summary refs log tree commit diff stats
path: root/tools/dnsmasq.html
blob: f738d767c5e4124bdfa0e873012f47bdd9e18e4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html dir="ltr" lang="en">
    <head>
        <meta charset='utf-8'>
        <title>Dnscrypt and Dnsmasq</title>
    </head>
    <body>

        <a href="index.html">Tools Index</a>

        <h1>Dnscrypt and Dnsmasq</h1>

        <p>Configure your resolver with a server that don't
        censorship there for respect your freedom and privacy.
        Read <a href="https://trac.torproject.org/projects/tor/wiki/doc/DnsResolver/PublicDnsResolvers#PublicDNSServers">Tor Dns Resolver</a> for more information.</p>

        <pre>
        $ sudo useradd -M -r -s /bin/false -g net net
        </pre>


        <h2 id="dnscrypt">1. Dnscrypt</h2>

        <pre>
        $ prt-get depinst dnscrypt
        </pre>

        <p>Dnscrypt by default resolves to dnscrypt.eu-nl, check file
        /usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv for a list of
        compatible servers. Dnscrypt-proxy port from machine-ports contains
        <a href="../linux/conf/rc.d/dnscrypt-proxy">dnscrypt-proxy</a> init
        script configured to use dnscrypt.eu-dk resolver and run as 
        nobody user. Basic usage example;</p>

        <pre>
        $ sudo -u net  dnscrypt-proxy --daemonize --resolver-name=&lt;resolver name&gt;
        </pre>

        <h2 id="dnsmasq">2. Dnsmasq</h2>

        <p>Edit <a href="../linux/conf/resolv.conf">resolv.conf</a>;</p>

        <pre>
        # /etc/resolv.conf.head can replace this line
        nameserver 127.0.0.1
        # CCC server
        # nameserver 213.73.91.35
        # OpenNIC Servers
        # nameserver 192.71.249.83
        # nameserver 5.135.183.146
        </pre>

        <p>Make sure daemons like dhcpd don't change it,
        turn on immutable attribute;</p>

        <pre>
        $chattr +i resolv.conf
        </pre>

        <p>Dnsmasq provides dns caching and dhcpd, example configuration
        files:
        <a href="../linux/conf/dnsmasq.conf">dnsmasq.conf</a> (change interface),
        <a href="../linux/conf/hosts.dnsmasq">hosts.dnsmasq</a>.</p>

        <p>Check /var/lib/dhcp/dnsmasq.leases to get list of dhcp leases
        assigned.</p>

        <h3>Local host</h3>

	<p>To configure dnsmasq for local host only change configuration provided values to;</p>

        <pre>
	server=10.0.0.254
	#local=/ank/
	#interface=br0
	#interface=wlp7s0
	listen-address=127.0.0.7
	#no-dhcp-interface=wlp7s0
	#dhcp-range=10.0.0.100,10.0.0.200,255.0.0.0,2h
	#enable-tftp
        </pre>

        <a href="index.html">Tools Index</a>

        <p>
        This is part of the LeetIO System Documentation.
        Copyright (C) 2021
        LeetIO Team.
        See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> for copying conditions.</p>
    </body>
</html>