So I decided to tell you how to bind a subdomain of my domain to my home server, and not to pay for my static IP address to my provider (Internet traffic).
We will need:
- Light head (like mine) - 1pc .
- Hands - 2pcs . (it is possible and one, but, IMHO, two more convenient)
- Own domain (preferably second level, because the third is not cool) with the ability to change DNS records - 1 pc .
- Home server (on the fra ;-)) - 1pc .
- Internet with “White”, dynamic IP address - 1pc .
It's enough.
')
Now we will start implementation:
First of all, we need an account on
dyndns.com (or any other similar service). We go through a simple registration, log in and follow the link
Add Host Services , do not worry, it's free ;-)
Fill in the link simple form:
- Hostname - We invent ourselves a subdomain (you can not very beautiful, others will not see it).
- Wildcard - if you do not know why you need it, then do not mark.
- Service Type - leave the Host with IP address .
- IP Address - click on the link Use auto detected IP address **. **. **. ** under the form.
- Mail Routing - again, if you don’t know why you need it, then don’t touch it.
Click the
Create Host button and if the selected domain is not busy, then we get the domain in the zone you selected, which will be mapped to the specified ip address.
We remember our credentials (login password) and the created domain and proceed to setting up the server.
I have
FreeBSD , so the settings will be for it.
We will need any
DynDNS client, I chose
ddclient , and we will install it.
We open the console under the root
Execute commands:
# cd /usr/ports/dns/ddclient
# make install clean
# echo ddclient_enable=\"YES\" >> /etc/rc.conf
# touch /usr/local/etc/ddclient.conf
# ee /usr/local/etc/ddclient.conf
# cd /usr/ports/dns/ddclient
# make install clean
# echo ddclient_enable=\"YES\" >> /etc/rc.conf
# touch /usr/local/etc/ddclient.conf
# ee /usr/local/etc/ddclient.conf
# cd /usr/ports/dns/ddclient
# make install clean
# echo ddclient_enable=\"YES\" >> /etc/rc.conf
# touch /usr/local/etc/ddclient.conf
# ee /usr/local/etc/ddclient.conf
# cd /usr/ports/dns/ddclient
# make install clean
# echo ddclient_enable=\"YES\" >> /etc/rc.conf
# touch /usr/local/etc/ddclient.conf
# ee /usr/local/etc/ddclient.conf
# cd /usr/ports/dns/ddclient
# make install clean
# echo ddclient_enable=\"YES\" >> /etc/rc.conf
# touch /usr/local/etc/ddclient.conf
# ee /usr/local/etc/ddclient.conf
In the editor, we write the config:
daemon=300 # 300 ip
syslog=yes # l syslog
pid=/var/run/ddclient.pid # PID
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
login=your_login # dyndns.com
password=super_password #
server=members.dyndns.org, \
protocol=dyndns2 \
tram-pampam.homeip.net #
Save all this art and try to start the demon (there should be no errors)
# /usr/local/etc/rc.d/ddclient start
You can reboot the server and check the ip of the domain you created, it should match yours.
With this done, the matter remains for small - to configure the DNS of your Second Level Domain (have you forgotten about it?), And its setup is very simple:
Go to the control panel of your domain and create a
CNAME record of the form:
home CNAME tram-pampam.homeip.net.
dot at the end of the domain is required!
This entry matches your subdomain with your dynamic ip address.
You can create multiple CNAME records for different subdomains.
home1 CNAME tram-pampam.homeip.net.
home2 CNAME tram-pampam.homeip.net.
home3 CNAME tram-pampam.homeip.net.
they will all work
Applications for this method can be found a bunch, ranging from game servers on the home server, to personal jabber server :)
Enjoy!