Install .NET 7 on Ubuntu using Snap

sudo snap install dotnet-sdk --classic --channel=7.0
sudo snap alias dotnet-sdk.dotnet dotnet

You can edit your shell profile to permanently add the commands.

Bash Shell: ~/.bash_profile, ~/.bashrc

export DOTNET_ROOT=/snap/dotnet-sdk/current


Installing dnscrypt-proxy on Linux

Get a root shell

sudo -s

check what else is possibly already listening to port 53

ss -lp 'sport = :domain'
systemctl stop systemd-resolved
systemctl disable systemd-resolved
ss -lp 'sport = :domain'

Download and run dnscrypt-proxy

Download dnscrypt-proxy here: dnscrypt-proxy binaries.

cp example-dnscrypt-proxy.toml dnscrypt-proxy.toml

Change the system DNS settings

apt-get remove resolvconf
cp /etc/resolv.conf /etc/resolv.conf.backup
rm -f /etc/resolv.conf

And create a new /etc/resolv.conf file with the following content:

options edns0

Install the proxy as a system service

./dnscrypt-proxy -service install
./dnscrypt-proxy -service start
./dnscrypt-proxy -service stop
./dnscrypt-proxy -service restart
./dnscrypt-proxy -service uninstall

Want to check that DNS resolution works?

./dnscrypt-proxy -resolve

Connect to using DoH clients

Add cloudflare and cloudflare-ipv6 to the server list in dnscrypt-proxy.toml:

server_names = ['cloudflare', 'cloudflare-ipv6']


Linux Host File

The hosts file is a way to map hostnames to IP addresses. This is very important with certain setups and to make networking on Linux a bit easier. In a sense, the hosts file acts as a local DNS server.

sudo nano /etc/hosts

For example, to block Wikipedia, you’d type (remembering to use the Tab key rather than Space):

or static dns lookup for hostnames


Configure Shadowsocks + V2ray + TLS + Apache + CDN on Ubuntu


nano /etc/shadowsocks/config.json
    "plugin_opts":"server;path=/ss;loglevel=none", # loglevel=debug


nano /etc/apache2/apache2.conf
<VirtualHost *:80>
    RewriteEngine on
    RewriteCond %{SERVER_NAME}
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URL} [END,NE,R=permanent]

<VirtualHost *:443>
    # change your domain
    # you may have a different root
    DocumentRoot /var/www/

    # the SSL configuration enable https for your site and it’s also required by shadowsocks + v2ray
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/
    SSLCertificateKeyFile /etc/letsencrypt/

    SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 +TLSv1.2 +TLSv1.3
    SSLCipherSuite HIGH:!aNULL

    <Location "/ss">
    ProxyPass ws://
    ProxyAddHeaders Off
    ProxyPreserveHost On
    RequestHeader append X-Forwarded-For %{REMOTE_ADDR}s