<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arnaudv6</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arnaudv6"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Arnaudv6"/>
	<updated>2026-05-04T03:39:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sysctl.conf&amp;diff=32270</id>
		<title>Sysctl.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sysctl.conf&amp;diff=32270"/>
		<updated>2026-04-04T13:40:02Z</updated>

		<summary type="html">&lt;p&gt;Arnaudv6: net.ipv4.tcp_tw_recycle has been removed from Linux in 4.12 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4396e46187&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:sysctl.conf}}sysctl.conf is the configuration file at &amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt; for [https://linux.die.net/man/8/sysctl sysctl] and is used to configure kernel parameters at boot time.  You can load the configuration file with {{Cmd|sysctl -p}} or simply with a reboot.&lt;br /&gt;
This article is not an exhaustive list but covers some of the main points. You may, of course, wish to change some settings to suite your environment.  The config examples are well commented so should provide all the information you need.  If further information is required on anything, please make a note in this page or in the &#039;discussion&#039; area.&lt;br /&gt;
Some of the options shown in the below examples may already be as default in your release. Check with &amp;lt;pre&amp;gt;sysctl -a|grep &amp;lt;somestring&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lines beginning with a hash &#039;#&#039; are comments and are thus not read until the # is removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= IPv6 =&lt;br /&gt;
Although IPv6 is [[Configure Networking|configured]] in  &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; more advanced options are configured in &amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
####Turn off IPv6 Routing####&lt;br /&gt;
## if not functioning as a router, there is no need&lt;br /&gt;
## to accept redirects or source routes&lt;br /&gt;
net.ipv6.conf.all.accept_redirects = 0&lt;br /&gt;
net.ipv6.conf.all.accept_source_route = 0&lt;br /&gt;
## Number of Router Solicitations to send until assuming no routers are present.&lt;br /&gt;
## This is a host and not router&lt;br /&gt;
net.ipv6.conf.default.router_solicitations = 2&lt;br /&gt;
&lt;br /&gt;
## Router advertisements can cause the system to assign a global &lt;br /&gt;
## unicast address to an interface&lt;br /&gt;
## Turn on/off below (default is 1, on)&lt;br /&gt;
#net.ipv6.conf.default.autoconf = 0&lt;br /&gt;
## How many global unicast IPv6 addresses can be assigned to each interface?&lt;br /&gt;
#net.ipv6.conf.all.max-addresses = 1&lt;br /&gt;
#net.ipv6.conf.default.max_addresses = 1&lt;br /&gt;
&lt;br /&gt;
##Force IPv6 off&lt;br /&gt;
#net.ipv6.conf.all.disable_ipv6 = 1&lt;br /&gt;
#net.ipv6.conf.default.disable_ipv6 = 1&lt;br /&gt;
#net.ipv6.conf.lo.disable_ipv6 = 1&lt;br /&gt;
#net.ipv6.conf.eth0.disable_ipv6 = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= General networking and performance =&lt;br /&gt;
Do not enable (uncomment) any of this unless you know what you are doing!!  Be prepared to perform thorough testing and potentially break stuff!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### Disable routing&lt;br /&gt;
## send redirects (not a router, disable it)&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
## log martian packets&lt;br /&gt;
#net.ipv4.conf.all.log_martians = 1&lt;br /&gt;
&lt;br /&gt;
### Memory and buffer changes. See https://wwwx.cs.unc.edu/~sparkst/howto/network_tuning.php {{Dead link}} for more information.&lt;br /&gt;
## Increase maximum amount of memory allocated to shm&lt;br /&gt;
#kernel.shmmax = 1073741824 &lt;br /&gt;
## Improve file system performance &lt;br /&gt;
#vm.bdflush = 100 1200 128 512 15 5000 500 1884 2 &lt;br /&gt;
## This will increase the amount of memory available for socket input/output queues &lt;br /&gt;
#net.ipv4.tcp_rmem = 4096 87380 524288  &lt;br /&gt;
#net.core.rmem_max = 1048576 &lt;br /&gt;
#net.core.rmem_default = 524288 &lt;br /&gt;
#net.ipv4.tcp_wmem = 4096 65536 524288&lt;br /&gt;
#net.core.wmem_max = 1048576&lt;br /&gt;
#net.core.wmem_default = 524288 &lt;br /&gt;
#net.core.optmem_max = 25165824&lt;br /&gt;
&lt;br /&gt;
## Increase system file descriptor limit    &lt;br /&gt;
fs.file-max = 65535&lt;br /&gt;
&lt;br /&gt;
## Allow for more PID&#039;s&lt;br /&gt;
kernel.pid_max = 65536&lt;br /&gt;
&lt;br /&gt;
## Swapping too much or not enough? Disks spinning up when you&#039;d&lt;br /&gt;
## rather they didn&#039;t? Tweak these.&lt;br /&gt;
#vm.vfs_cache_pressure = 100&lt;br /&gt;
#vm.laptop_mode = 0&lt;br /&gt;
#vm.swappiness = 60&lt;br /&gt;
&lt;br /&gt;
## Set small dirty bytes values (overcomes random short system freezes)&lt;br /&gt;
## If you uncomment the below, it is set to 4MB&lt;br /&gt;
#vm.dirty_background_bytes = 4194304&lt;br /&gt;
#vm.dirty_bytes = 4194304&lt;br /&gt;
&lt;br /&gt;
## reuse time-wait sockets (this is often needed on busy servers)&lt;br /&gt;
net.ipv4.tcp_tw_reuse = 1&lt;br /&gt;
&lt;br /&gt;
## Controls the number of syn retries (default is 6)&lt;br /&gt;
#net.ipv4.tcp_syn_retries = 3&lt;br /&gt;
## Controls the number of tcp syn-ack retries (default is 5)&lt;br /&gt;
#net.ipv4.tcp_synack_retries = 3&lt;br /&gt;
&lt;br /&gt;
## Change the time default value for tcp_fin_timeout connection &lt;br /&gt;
## (i.e. time to hold socket in FIN-WAIT-2 if it was closed by us)&lt;br /&gt;
## Default is 60 seconds&lt;br /&gt;
#net.ipv4.tcp_fin_timeout = 15 &lt;br /&gt;
## Decrease the time default value for tcp_keepalive_time connection&lt;br /&gt;
## (i.e. how often to send TCP keepalive message)&lt;br /&gt;
## Default is 2 hours! &lt;br /&gt;
#net.ipv4.tcp_keepalive_time = 360 &lt;br /&gt;
## Turn on tcp_window_scaling &lt;br /&gt;
#net.ipv4.tcp_window_scaling = 1 &lt;br /&gt;
## Turn on the tcp_sack &lt;br /&gt;
#net.ipv4.tcp_sack = 1 &lt;br /&gt;
## tcp_fack should be on because of sack &lt;br /&gt;
#net.ipv4.tcp_fack = 1 &lt;br /&gt;
&lt;br /&gt;
## Set the port range used for outgoing connections&lt;br /&gt;
#net.ipv4.ip_local_port_range = 1200    65000&lt;br /&gt;
&lt;br /&gt;
## the number of packets to queue on input when they arrive faster&lt;br /&gt;
## than they can be processed by the kernel (the socket queue)&lt;br /&gt;
#net.core.netdev_max_backlog = 3000&lt;br /&gt;
&lt;br /&gt;
## Maximum number of remembered connection requests which have not&lt;br /&gt;
## received an ack from connecting client.  Increases in proportion&lt;br /&gt;
## to available memory.  Set it manually below&lt;br /&gt;
#net.ipv4.tcp_max_syn_backlog = 1000&lt;br /&gt;
&lt;br /&gt;
#Don&#039;t penalize programs for using split locks. Marginally speeds up the steam and Google Chrome flatpaks.&lt;br /&gt;
kernel.split_lock_mitigate = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Security =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Disable magic-sysrq key&lt;br /&gt;
kernel.sysrq = 0&lt;br /&gt;
&lt;br /&gt;
## Restrict dmesg access to root&lt;br /&gt;
kernel.dmesg_restrict = 1&lt;br /&gt;
&lt;br /&gt;
## optionally, ignore all echo requests&lt;br /&gt;
## this is NOT recommended, as it ignores echo requests on localhost as well&lt;br /&gt;
#net.ipv4.icmp_echo_ignore_all = 1&lt;br /&gt;
&lt;br /&gt;
## Don&#039;t expose kernel memory addresses in procfs&lt;br /&gt;
kernel.kptr_restrict = 2&lt;br /&gt;
&lt;br /&gt;
## Restrict access to kernel performance events&lt;br /&gt;
kernel.perf_event_paranoid = 2&lt;br /&gt;
&lt;br /&gt;
## Restrict unprivileged access to eBPF&lt;br /&gt;
kernel.unprivileged_bpf_disabled = 1&lt;br /&gt;
&lt;br /&gt;
## Enable JIT hardening techniques for eBPF&lt;br /&gt;
net.core.bpf_jit_harden = 2&lt;br /&gt;
&lt;br /&gt;
## Disable core dumps&lt;br /&gt;
kernel.core_pattern=|/bin/false&lt;br /&gt;
&lt;br /&gt;
## Restrict access to the ptrace() syscall&lt;br /&gt;
## a value of 3 disables ptrace() entirely&lt;br /&gt;
kernel.yama.ptrace_scope = 2&lt;br /&gt;
&lt;br /&gt;
## Increase bits of entropy for ASLR&lt;br /&gt;
## these values are compatible with x86, but other archs may differ&lt;br /&gt;
vm.mmap_rnd_bits = 32&lt;br /&gt;
vm.mmap_rnd_compat_bits = 16&lt;br /&gt;
&lt;br /&gt;
# Heavily restrict writing to FIFOs; they must be owned, not in sticky dirs...                                                                                                                                                                       &lt;br /&gt;
fs.protected_fifos = 2&lt;br /&gt;
# don&#039;t allow O_CREAT open on regular files that we don&#039;t own in world/group writable sticky directories,&lt;br /&gt;
# unless they are owned by the owner of the directory.&lt;br /&gt;
fs.protected_regular = 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]][[Category:Security]][[Category:Kernel]]&lt;/div&gt;</summary>
		<author><name>Arnaudv6</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=LabWC&amp;diff=28495</id>
		<title>LabWC</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=LabWC&amp;diff=28495"/>
		<updated>2024-12-19T08:03:34Z</updated>

		<summary type="html">&lt;p&gt;Arnaudv6: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://labwc.github.io LabWC] is a stacking [[Wayland]] compositor. Although [https://github.com/labwc/labwc#1-what-is-this it wasn&#039;t intended like that], it can serve as a drop-in replacement for the [[Openbox]] window manager (the same way [[Sway]] is for [[I3wm]]).&lt;br /&gt;
&lt;br /&gt;
This wiki was written starting from a fresh install using the Alpine 3.16 x86 extended .iso. The steps begin from the first reboot after running setup-alpine and performing a sys install to disk. &lt;br /&gt;
&lt;br /&gt;
Many steps below were taken from the [[Sway|wiki entry for installing Sway]], as both are wlroots-based Wayland compositors. Another interesting page, because of the same reasons, is the [[River]] compositor&#039;s.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
{{Note|These steps posted as both Sway and LabWC prerequisites could be applied to almost all wlroots-based Wayland compositors.}}&lt;br /&gt;
&lt;br /&gt;
{{:Include:Setup_Device_Manager}}&lt;br /&gt;
&lt;br /&gt;
Then install the mesa gallium drivers:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add mesa-dri-gallium}}&lt;br /&gt;
&lt;br /&gt;
The following links contain guides for setting up the video stack.&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add yourself to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;amp;#35; adduser $USER input&lt;br /&gt;
&amp;amp;#35; adduser $USER video&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You have to log out and back in for this to take effect. &lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add font-dejavu}}&lt;br /&gt;
&lt;br /&gt;
Since wlroots 0.14, you need to set up libseat backend if you wish to run labwc directly (without nesting it in another wayland compositor). To do that, [[Repositories#Enabling_the_community_repository|enable the community repository]] and choose one of the following methods:&lt;br /&gt;
&lt;br /&gt;
=== Option 1: seatd daemon (recommended) ===&lt;br /&gt;
See [[Seatd]].&lt;br /&gt;
&lt;br /&gt;
=== Option 2: seatd-launch ===&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add seatd-launch}}&lt;br /&gt;
&lt;br /&gt;
When starting labwc, you will need to prefix invocation with &amp;lt;code&amp;gt;seatd-launch&amp;lt;/code&amp;gt;.  &lt;br /&gt;
Note: &amp;lt;code&amp;gt;seatd-launch&amp;lt;/code&amp;gt; is a suid binary, so it might be wise to use one of the other methods from a security perspective.&lt;br /&gt;
&lt;br /&gt;
=== Option 3: elogind daemon ===&lt;br /&gt;
&lt;br /&gt;
See [[Elogind]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
We can now install labwc:&lt;br /&gt;
{{Cmd|&amp;amp;#35; apk add labwc labwc-doc&lt;br /&gt;
&amp;amp;#35; apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    rofi                 \ # default application launcher (dmenu could be used instead)&lt;br /&gt;
    swaylock             \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle             \ # idle management (DPMS) daemon&lt;br /&gt;
    dbus-x11&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that almost all optional dependencies are the same as Sway&#039;s.&lt;br /&gt;
&lt;br /&gt;
== Running LabWC ==&lt;br /&gt;
&lt;br /&gt;
To run labwc, first set up [[XDG_RUNTIME_DIR]] Then run labwc from the Linux console (dbus-launch is used because pipewire needs it, it is included in dbus-x11 and you may omit it):&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ dbus-launch labwc}}&lt;br /&gt;
&lt;br /&gt;
(if you run labwc with seatd-launch, you will need to use &amp;lt;code&amp;gt;$ dbus-launch seatd-launch labwc&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
You can also create a simple alias in your shell rc file (e.g. .zshrc), like:&lt;br /&gt;
{{Cmd|alias labwcinit&amp;amp;#61;&amp;quot;dbus-launch seatd-launch labwc&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
swaylock needs to be able to read your &amp;lt;code&amp;gt;/etc/shadow&amp;lt;/code&amp;gt; file to be able to validate your password&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Configuration and Usage ==&lt;br /&gt;
&lt;br /&gt;
LabWC aims to implement the [http://openbox.org/wiki/Help:Contents openbox 3.4] specification, so many things working in OpenBox should be compatible.&lt;br /&gt;
&lt;br /&gt;
Moreover, the project provides [https://github.com/labwc/labwc#4-configure examples for all the configuration files] and some themes, explaining where it must be located each one of them.&lt;br /&gt;
&lt;br /&gt;
For additional information, labwc [https://labwc.github.io/manual.html manpages] and [https://github.com/labwc/labwc/wiki wiki] can be consulted.&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Wayland]]&lt;br /&gt;
[[Category:compositor]]&lt;/div&gt;</summary>
		<author><name>Arnaudv6</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_an_NFS_server&amp;diff=27410</id>
		<title>Setting up an NFS server</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_an_NFS_server&amp;diff=27410"/>
		<updated>2024-09-26T12:21:55Z</updated>

		<summary type="html">&lt;p&gt;Arnaudv6: bin name: exports -&amp;gt; exportfs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
Install the following package for both NFS client and NFS server service.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add nfs-utils}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
Setting up NFS service on Alpine Linux is no different from other Linux distributions.&lt;br /&gt;
&lt;br /&gt;
=== NFS Server ===&lt;br /&gt;
&lt;br /&gt;
Setup export dirs in /etc/exports. For example:&lt;br /&gt;
{{Cat|/etc/exports|&amp;lt;nowiki&amp;gt;/data 10.10.10.0/24(rw,nohide,no_subtree_check,no_root_squash)    &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
After editing /etc/exports, reload your setting&lt;br /&gt;
{{Cmd|# exportfs -afv}}&lt;br /&gt;
&lt;br /&gt;
To make NFS server service to autostart on boot:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-update add nfs}}&lt;br /&gt;
&lt;br /&gt;
To start NFS server service now &lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-service nfs start}}&lt;br /&gt;
&lt;br /&gt;
=== NFS Client ===&lt;br /&gt;
&lt;br /&gt;
To mount NFS shares automatically, an entry needs to made to /etc/fstab. To mount nfs share from /etc/fstab file at booting of the system&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-update add nfsmount}}&lt;br /&gt;
&lt;br /&gt;
To mount the nfs shares from /etc/fstab file now:&lt;br /&gt;
{{Cmd|# rc-service nfsmount start}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-update add netmount}}&lt;br /&gt;
&lt;br /&gt;
You can check your boot services:&lt;br /&gt;
{{Cmd|# rc-status}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-service netmount start}}&lt;br /&gt;
&lt;br /&gt;
== Kerberos Authentication ==&lt;br /&gt;
&lt;br /&gt;
By default, NFS security only validates the IP of the client. You can add user level authentication with a Kerberos installation ([https://pkgs.alpinelinux.org/package/edge/main/armhf/krb5 MIT KRB5] or [https://pkgs.alpinelinux.org/package/edge/main/x86/heimdal Heimdal]). It is recommended to have the same Kerberos flavor across the network as both implementations are not completely mutually compatible.&lt;br /&gt;
&lt;br /&gt;
=== Server Configuration ===&lt;br /&gt;
&lt;br /&gt;
Assuming you setup Kerberos in the in the network, create ticket to your NFS machine (examples are in MIT KRB5 syntax):&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# kadmin: addprinc -randkey nfs/nfs1.example.com@EXAMPLE.COM}}&lt;br /&gt;
&lt;br /&gt;
And add it to the machines krb5.keytab file:&lt;br /&gt;
{{Cmd|# kadmin: ktadd nfs/nfs1.example.com@EXAMPLE.COM}}&lt;br /&gt;
&lt;br /&gt;
Then, edit your /etc/exports, and add sec=krb5 (only authentication), sec=krb5i (also hmac signing) or sec=krb5p (also encryption). For example:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/exports|&amp;lt;nowiki&amp;gt;/data 10.10.10.0/24(rw,nohide,no_subtree_check,sec=krb5p,no_root_squash)    &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
After editing /etc/exports, reload your setting&lt;br /&gt;
{{Cmd|# exportfs -afv}}&lt;br /&gt;
&lt;br /&gt;
User id mapping is managed by nfsidmap.&lt;br /&gt;
&lt;br /&gt;
=== Client Configuration ===&lt;br /&gt;
&lt;br /&gt;
In order for the client to connect to NFS via kerberos, enable and start rpc.gssd.&lt;br /&gt;
{{Cmd|# rc-update add rpc.gssd}}&lt;br /&gt;
{{Cmd|# rc-service rpc.gssd start}}&lt;br /&gt;
&lt;br /&gt;
== see Also ==&lt;br /&gt;
* [https://wiki.archlinux.org/title/NFS NFS in Arch wiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Nfs-utils NFS in Gentoo Wiki] &lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;/div&gt;</summary>
		<author><name>Arnaudv6</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Using_Unbound_as_an_Ad-blocker&amp;diff=26386</id>
		<title>Using Unbound as an Ad-blocker</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Using_Unbound_as_an_Ad-blocker&amp;diff=26386"/>
		<updated>2024-02-13T18:18:42Z</updated>

		<summary type="html">&lt;p&gt;Arnaudv6: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background == &lt;br /&gt;
&lt;br /&gt;
There is a fairly popular software product that acts as a DNS blocker for Advertisements and Malware.  It runs on the Raspberry &amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;Pi-&amp;lt;/span&amp;gt; and claims to be a DNS Black &amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;Hole&amp;lt;/span&amp;gt;.  It extends dnsmasq with filtering based on a downloadable blacklist.   There is a [https://gitlab.alpinelinux.org/alpine/aports/issues/9489 package request] for this software to run on Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
The binary does compile on Alpine, however there is an extensive list of extraneous files, directories and packages that must be installed to get the modified version of {{Pkg|dnsmasq}} to start.  The &amp;quot;basic installer&amp;quot; is over 2600 lines of Bash code.  &lt;br /&gt;
&lt;br /&gt;
Our goal is to get 80% of the functionality with 10% of the work.&lt;br /&gt;
&lt;br /&gt;
== Basic Components ==&lt;br /&gt;
&lt;br /&gt;
You should have {{Pkg|dnsmasq}} (or another DHCP server) and [[Setting_up_unbound_DNS_server|unbound]] both working on your network.  &lt;br /&gt;
&lt;br /&gt;
== Setting up Unbound To Block/Refuse unwanted addresses ==&lt;br /&gt;
&lt;br /&gt;
There are a number of freely available blacklists on the net.  The installer mentioned above uses these lists by default:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts&lt;br /&gt;
https://mirror1.malwaredomains.com/files/justdomains&lt;br /&gt;
http://sysctl.org/cameleon/hosts&lt;br /&gt;
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt&lt;br /&gt;
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt&lt;br /&gt;
https://hosts-file.net/ad_servers.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, there is a set of curated lists at https://github.com/StevenBlack/hosts. There are various categories of lists there. The format of the file is a &amp;quot;host&amp;quot; (so you can put it in &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; and be done). We will use the hosts file format:&lt;br /&gt;
&lt;br /&gt;
unbound needs to include the &amp;lt;code&amp;gt;blacklists.conf&amp;lt;/code&amp;gt; file into its main configuration. To do so, we need to create the include file in the following format:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/unbound/blacklists.conf|server:&lt;br /&gt;
&lt;br /&gt;
local-zone: &amp;quot;bad-site.com&amp;quot; refuse&lt;br /&gt;
local-zone: &amp;quot;bad-bad-site.com&amp;quot; refuse&lt;br /&gt;
local-zone: &amp;quot;xyz.ads-r-us.com&amp;quot; refuse}}&lt;br /&gt;
&lt;br /&gt;
Here is an example shell script to download the&lt;br /&gt;
[https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts StevenBlack]&lt;br /&gt;
hosts file, and then format it for unbound:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;server:&amp;quot; &amp;gt;/etc/unbound/blacklist.conf&lt;br /&gt;
curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | \&lt;br /&gt;
        grep ^0.0.0.0 - | \&lt;br /&gt;
        sed &#039;s/ #.*$//;&lt;br /&gt;
        s/^0.0.0.0 \(.*\)/local-zone: &amp;quot;\1&amp;quot; refuse/&#039; \&lt;br /&gt;
        &amp;gt;&amp;gt;/etc/unbound/blacklist.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can run this once, or as part of a periodic cron task.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;/etc/unbound/unbound.conf&amp;lt;/code&amp;gt;, add the following line somewhere in the config:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/unbound/unbound.conf|#include &amp;quot;/etc/unbound/blacklist.conf&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Reload unbound, and verify the config loads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dnsmasq configuration ==&lt;br /&gt;
&lt;br /&gt;
Dnsmasq defaults to using the resolver in &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; — if unbound is listening on &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;, then have it use that as the resolver.&lt;br /&gt;
&lt;br /&gt;
Alternatively, if unbound is running on another interface, or on a separate machine — use the dhcp-option configuration in dnsmasq:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dhcp-option=6,[ip-of-unbound-server]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy Ad-Free browsing!&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Arnaudv6</name></author>
	</entry>
</feed>