By Martin Stut, 2017-02-09

In this post, I’m describing what it takes to set up a website and a few email addresses, if your usual web hosting company won’t do it at a reasonable price. None of these steps are unusual, but it is nice to have them written down in one place, including working examples of the syntax. The target audience are IT technicians, who might end up doing this for several domains.

Usually, at least in the German market, all of this is done by the web hosting company. But recently I had the task to perform this not for a German, but for a Kyrgyz customer. Things do work different there. European hosting companies, if they offer .kg-domains at all, charge 180 to 270 USD per year just for the domain registration, while does it for the equivalent of 37 USD per year. So I set out to do it on my own.

Make Sure You Have At Least Two Name Servers

For reliability, all Internet domain names are required to be resolved by at least two different name servers. Make sure you have access to both of them. If not, get a small VPS (Virtual Private Server) from a provider like Hetzner or HostEurope. Details of getting a VPS are beyond the scope of this text.

In several places you need to enter numeric IP-Addresses. In this example I’m using ( for the primary (authoritative) name server and ( for the secondary name server.

Get the Domain Delegation

Through an appropriate registrar, in this case, “buy the domain”. You will need to specify the DNS names and IP addresses of the name servers. In the case I worked with, the customer did this on his own from within Kyrgyzstan.

Authoritative Name Server

Example IP-Address:

The server selected to become the primary name server is a VPS running Debian 7 Linux.

zone "" {
  type master;
  file "/etc/bind/";
  also-notify {; };
    $ttl 38400
    @       SOA (
                    86400 )
    @       NS
    @       NS
    @       A
    www     A

Secondary Name Server

Example IP-Address:

    zone "" {
        type slave;
        file "/var/cache/bind/";
        masters {; };

Check DNS

The tool of choice on Linux seems to be zonecheck (man page).

  1. apt-get install zonecheck
  2. zonecheck --ns\; The backslash before the semicolon is important to avoid the shell misinterpreting the semicolon as and of command.
  3. Work through zonecheck’s errors and warnings.

Web Server

Assuming apache2 is already installed.

    DocumentRoot /home/example/public_html
    <Directory /home/example/public_html/ >
               Require all granted
    ErrorLog /home/example/logs/error.log
    CustomLog /home/example/logs/access.log combined

Arrange for https

Wait until the DNS entry has publicly spread.

Follow the instructions on

This creates and enables a new site example-le-ssl.conf in the Apache configuration.

Yes, letsencrypt is really that easy, if you are using a supported OS/web server pair.


This is the hardest part. I consider it out of reach of a less-than-full-time administrator to manage an SMTP server with reasonable spam filtering.

Options include:

In this case we decided to go with, as about a dozen mailboxes were needed.

End of the Story

DF’s hosting package turned out to be all we need, so I changed all the DNS records to point to df’s servers, let the customer change the domain’s DNS server to DF’s - and considered doing the steps described here as an exercise that won’t go into long term production.