This quick guide may be useful to those looking for an alternative to VNC (e.g. https://vpsboard.com/topic/2786-running-a-lightweight-gui-on-your-vps/) or X2Go. In short you will be able to use your VPS as a DNS server and a selective proxy server, i.e. you'll have to specify the websites that Bind and SNI Proxy should communicate with. This will allow you to browse the internet with two different IP addresses depending on the websites you load.
For the sake of brevity and amusement, the Bind config here is super minimal and the naming is non-standard. If you're new to DNS, you may want to supplement or cross reference it with something like https://www.digitalocean.com/community/tutorials/an-introduction-to-dns-terminology-components-and-concepts.
The following has been tested in Ubuntu 14.04 32-bit. If you would prefer not to use Bind, a similar effect can be acheived with Dnsmasq. Okay, so,
1. Install Bind.
apt-get install bind9 bind9utils bind9-doc
2. Install the required packages for sniproxy.
apt-get install git build-essential autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot3. Build and install it.
git clone https://github.com/dlundquist/sniproxy.git
cd sniproxy
./autogen.sh && dpkg-buildpackage
dpkg -i ../sniproxy_0.4.0_i386.deb4. Configure Bind. We will be using http://whatismyip.com for the test site (or any site of your choosing). Replace "1.2.3.4" with the IP address of your VPS.
nano /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
recursion yes;
allow-query { noetics; };
dnssec-validation auto;
auth-nxdomain no;
listen-on-v6 { any; };
};
acl "noetics" {
any;
};
5. Configure SNI Proxy. Again, sublate "1.2.3.4" into your VPS IP.
nano /etc/sniproxy.conf
user daemon
pidfile /var/tmp/sniproxy.pid
listen 1.2.3.4 80 {
proto http
fallback localhost:8080
}
listen 1.2.3.4 443 {
proto tls
}
table {
whatismyip\.com *
}
6. Beep boop start it up and reboot your VPS.
service bind9 start; service sniproxy restart; reboot
7. Change the DNS settings on the device you use to connect to the internet to your new DNS server: 1.2.3.4.
8. Go to http://whatismyip.com. If it worked, the IP address of your VPS will appear. Edit /etc/bind/zones.noetics and /etc/sniproxy.conf to add more sites. The End.
For the sake of brevity and amusement, the Bind config here is super minimal and the naming is non-standard. If you're new to DNS, you may want to supplement or cross reference it with something like https://www.digitalocean.com/community/tutorials/an-introduction-to-dns-terminology-components-and-concepts.
The following has been tested in Ubuntu 14.04 32-bit. If you would prefer not to use Bind, a similar effect can be acheived with Dnsmasq. Okay, so,
1. Install Bind.
apt-get install bind9 bind9utils bind9-doc
2. Install the required packages for sniproxy.
apt-get install git build-essential autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot3. Build and install it.
git clone https://github.com/dlundquist/sniproxy.git
cd sniproxy
./autogen.sh && dpkg-buildpackage
dpkg -i ../sniproxy_0.4.0_i386.deb4. Configure Bind. We will be using http://whatismyip.com for the test site (or any site of your choosing). Replace "1.2.3.4" with the IP address of your VPS.
nano /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
recursion yes;
allow-query { noetics; };
dnssec-validation auto;
auth-nxdomain no;
listen-on-v6 { any; };
};
acl "noetics" {
any;
};
Code:
nano /etc/bind/zones.noetics
zone "whatismyip.com." {
type master;
file "/etc/bind/db.noetics";
};
Code:
nano /etc/bind/db.noetics
$TTL 86400
@ IN SOA ns1 root (
1234561969 ; serial
604800 ; refresh 1w
86400 ; retry 1d
2419200 ; expiry 4w
86400 ; minimum TTL 1d
)
IN NS ns1
ns1 IN A 1.2.3.4
@ IN A 1.2.3.4
* IN A 1.2.3.4
Code:
nano /etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/etc/bind/zones.noetics";
nano /etc/sniproxy.conf
user daemon
pidfile /var/tmp/sniproxy.pid
listen 1.2.3.4 80 {
proto http
fallback localhost:8080
}
listen 1.2.3.4 443 {
proto tls
}
table {
whatismyip\.com *
}
Code:
nano /etc/default/sniproxy
DAEMON_ARGS="-c /etc/sniproxy.conf"
ENABLED=1
service bind9 start; service sniproxy restart; reboot
7. Change the DNS settings on the device you use to connect to the internet to your new DNS server: 1.2.3.4.
8. Go to http://whatismyip.com. If it worked, the IP address of your VPS will appear. Edit /etc/bind/zones.noetics and /etc/sniproxy.conf to add more sites. The End.
Last edited by a moderator: