I’ve been using FreeBSD a lot more recently and have built a VPN server so that myself and some friends can play some LAN games over the web, I know you can use other tools such as Hamanchi but I thought I’d setup my own VPN as I can use it for other things too 🙂
So as my public IP address is static, I needed to install a Dynamic DNS client so I can set a memorable DNS name for my dynamic IP address so external clients (in this case my friends don’t need to update their VPN client settings each time the IP address changes)
In the past I used to solely use DynDNS however in recent months they now only provide paid services and would cost me $20 a year to host a Dynamic DNS hostname so I decided to use the services of No-IP.org of which do the same thing but offer their service for free 🙂
So first of all, you’ll need to head over to No-IP.org and register yourself a free account.
Then setup a free domain name, for example myhomeserver.no-ip.org and then we can continue to configure our FreeBSD server, this has been fully tested on FreeBSD 9.0 but should work on both newer and older versions of FreeBSD too…
So, being logged on as ‘root’ execute the following command:
cd /usr/ports/dns/noip/
make install
The above commands have now compiled the No-IP update client from the FreeBSD ports tree on your server, next we need to create a No-IP client configuration file which contains your account details and other settings such as what NIC to use when updating over the internet etc. We can set up the configuration file either manually (creating a new file here /usr/local/etc/no-ip2.conf and configuring the parameters by hand.) however we will use the wizard by running this command:-
make conf
You’ll now be asked to enter infomation such as your No-IP account details etc, simply answer the questions when prompted at the end you’ll have a generated configuration file which you should be able to see generated in: /usr/local/etc/no-ip2.conf.
The last thing we need to do is to configure the No-IP daemon to run at system start-up, to do this, we need to edit /etc/rc.conf and add then the following line to the bottom of the file:-
noip_enable=”YES”
Restart your server and you should now see that the No-IP daemon has started and will now continue to monitor and update your No-IP account whenever your public IP address changes 🙂
TIP: Although I have my own No-IP account and use the standard xxx.no-ip.org domain name I have configured a CNAME sub-domain from my primary domain which points to my no-ip domain, this way you can make your hostname look more professional by hiding the fact your using a xxx.no-ip.org domain.