📜 ⬆️ ⬇️

Own domain on dynamic IP

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:

  1. Light head (like mine) - 1pc .
  2. Hands - 2pcs . (it is possible and one, but, IMHO, two more convenient)
  3. Own domain (preferably second level, because the third is not cool) with the ability to change DNS records - 1 pc .
  4. Home server (on the fra ;-)) - 1pc .
  5. 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:


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:
  1. # 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
  2. # 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
  3. # 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
  4. # 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
  5. # 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)
  1. # /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!

Source: https://habr.com/ru/post/54667/


All Articles