Dynamic DNS with your Raspberry Pi4, Namecheap and Tailscale
Recently, I setup a Raspberry Pi 4 with Pi-hole and Tailscale so that I didn’t get bombarded with banner ads while I surfed the web. It works great, but only if I’m at the house using my Wifi. With the pandemic nearly over, and our ability to move around more, I kinda got used to not seeing ads while I checked the news or played scrabble on my phone.
One of the things I wanted to do was to be able to
- Install perl and dependencies
- sudo apt-get install autoconf cpanminus
- cpan
- install CPAN
- reload cpan
- install module HTTP::Daemon:SSL
- Get the latest version of DDClient from Github
- cd ddclient
- ./autogen
- ./configure –prefix=/usr –sysconfdir=/etc/ddclient –localstatedir=/var
- make
- make VERBOSE=1 check
- sudo make install
vim /etc/ddclient/ddclient.conf
1
2
3
4
5
6
7
8
9
10
use=if, if=tailscale0
##
## NameCheap (namecheap.com)
##
protocol=namecheap, \
server=dynamicdns.park-your-domain.com, \
login=luther.io, \
password=GETYOURPASSWORDFROMTHENAMECHEAPUI \
HOSTNAME_YOU_WANT_TO_SET_IP_FOR
May 24 23:43:14 rpi ddclient[5761]: INFO: forcing updating rpi because no cached entry exists.
May 24 23:43:14 rpi ddclient[5761]: INFO: setting IP address to 100.114.93.47 for rpi
May 24 23:43:14 rpi ddclient[5761]: UPDATE: updating rpi
May 24 23:43:14 rpi ddclient[5761]: CONNECT: dynamicdns.park-your-domain.com
May 24 23:43:14 rpi ddclient[5761]: CONNECTED: using SSL
May 24 23:43:14 rpi ddclient[5761]: SENDING: GET /update?host=rpi&domain=luther.io&password=fe90414aee38420b8572b97d80328cf5&ip=100.114.93.47 HTTP/1.1
May 24 23:43:14 rpi ddclient[5761]: SENDING: Host: dynamicdns.park-your-domain.com
May 24 23:43:14 rpi ddclient[5761]: SENDING: User-Agent: ddclient/3.9.1
May 24 23:43:14 rpi ddclient[5761]: SENDING: Connection: close
May 24 23:43:14 rpi ddclient[5761]: SENDING:
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: HTTP/1.1 200 OK#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: Cache-Control: private#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: Content-Type: text/html#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: Set-Cookie: ASPSESSIONIDSQQBACSQ=NNCEPLOBOLOPDMMFKFGCHAEN; path=/#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: Date: Tue, 25 May 2021 04:43:14 GMT#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: Connection: close#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: Content-Length: 235#015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: #015
May 24 23:43:14 rpi ddclient[5761]: RECEIVE: <?xml version="1.0"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><IP>100.114.93.47</IP><ErrCount>0</ErrCount><ResponseCount>0</ResponseCount><Done>true</Done><debug><![CDATA[]]></debug></interface-response>
May 24 23:43:14 rpi ddclient[5761]: SUCCESS: updating rpi: good: IP address set to 100.114.93.47
May 24 23:43:44 rpi ddclient[5808]: SUCCESS: rpi: skipped: IP address was already set to 100.114.93.47.