Skip to content

Instantly share code, notes, and snippets.

@nwesterhausen
Last active May 29, 2022 12:07
Show Gist options
  • Save nwesterhausen/7ed54f9b041e5f149c71c390ccece0f7 to your computer and use it in GitHub Desktop.
Save nwesterhausen/7ed54f9b041e5f149c71c390ccece0f7 to your computer and use it in GitHub Desktop.
Stubby Installi instructions for Alpine 3.8

Stubby for Alpine 3.8

Install getdns

  1. Install Pre-requisites

    apk add gcc make openssl-dev unbound-dev musl-dev
    apk add libidn2-dev  --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
  2. Build getdns

    cd /tmp
    wget https://getdnsapi.net/releases/getdns-1-5-2/getdns-1.5.2.tar.gz
    tar xvf getdns-1.5.2.tar.gz
    cd getdns-1.5.2/
    ./configure
    make
    make install

Install stubby

  1. Install Pre-requisites

    apk add yaml-dev autoconf automake
  2. Build stubby

    cd /tmp
    git clone https://github.com/getdnsapi/stubby.git
    cd stubby
    autoreconf -vfi
    ./configure CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
    make
    sudo make install

Add OpenRC Script

The following script I threw together seems to work OK..

#!/sbin/openrc-run

depend() {
  need net
  before named
}

command="/usr/local/bin/stubby"
command_args="-gC /etc/stubby/stubby.yml"
pidfile="/usr/local/var/run/stubby.pid"
@oijkn
Copy link

oijkn commented May 29, 2022

Thank you for sharing but actually that doesn't work. For me this is the right way to build Stubby :

apk add --update alpine-sdk libidn2-dev unbound-dev cmake openssl-dev libev-dev libuv-dev check-dev yaml-dev \
        && git clone https://github.com/getdnsapi/getdns.git \
        && cd getdns && git checkout master && git submodule update --init \
        && mkdir build && cd build \
        && cmake -DBUILD_STUBBY=ON .. \
        && make && make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment