How to set up a secondary name server if you only have one IP address

botond published March 2018, 04, Thu - 26:11 time

Content

 

Introductory

In this tutorial, I will show you how to "set up" a new one domain name on our own server if we only have one IP address. During setup, here's the domain name name server based redirection when it's all over DNS zone is managed by ourselves on our server.

So you have a dedicated server and a fixed one IP address. We want to run websites on this by redirecting our domain names, which would not be a problem at first glance. We set up a server (I’ll write about that in another article) and then redirect the domain name over it. But here's a little trouble. Domain names require at least two name servers to work properly, which cannot be on the same network. So not only can we not use the same one-eye IP address, but the two name servers cannot be in the same / 24 address range. Otherwise, a Regcheck domain verification system will make a mistake. What should we do? How do we launch our new website on our own server? Fortunately, there is a perfect solution. 

When I started running this server, I was faced with exactly this when I wanted to launch my first website on it. Back then, as an absolute beginner, the task was sweaty because I had to move the website from another VPS server that expired to this server, where the first monthly fee had already been paid. So the clock was ticking, I needed a solution to this problem in 1-2 days, which I didn’t expect at all. By then ISPConfigos perfect serverI installed the environment based on the tutorials available, but I was there with the problem that I had to solve quickly. Luckily, I found the solution in time, and since then, several websites have been running flawlessly on this server using this method - so I can already say that I am routine in this.

Here I will show you step by step how to host the domain of this website on this server. Although I should have first described the installation of the server in chronological order, it has already become timely to "open" the page. And if I have to do that anyway, I'll make a description of it. On the other hand, later it will not matter which article was made first.

The description assumes that you are either Debian 8 (Jessie) is the perfect server or the Debian 9 (Stretch) is the perfect server is installed, so it's free ISPConfig a control panel is also available. As soon as I have completed such a description, I will link here.

Of course, this method works differently web hosting control panel where DNA zones can be managed.

 

 

The beginning

There are registrars who park newly registered domains on some of their own promotional space, display advertisements, and there are some that don't have the address directed anywhere. In my case, the latter is the case, so so far no linuxportal.info title. The regcheck then gives the following output:

A(z) linuxportal.info domain nem felel meg. Kérjük javítsa a konfigurációt.
Az egyes hibák részletes leírása itt található.
Kérjük, ha bármi megjegyzése van, írjon a hostmaster@.....hu címre.
Az ellenőrző procedúra outputja: 
............................................................................... 
M-GREET -I- [linuxportal.info] Domi version 20170905 at 2018-04-25.00:27 
M-STAR -I- [linuxportal.info] NS parameter not given, getting it from DNS 
M-PRIF -E- [linuxportal.info] Cannot get domain data ( )    Magyarázat 
...............................................................................

 

Create a DNS zone

We need to create the DNS zone on the server first. To do this, go to our webhosting control panel as admin (I will introduce you with ISPConfig) and create a DNS zone for the domain name and webhost:

ISPConfig - DNS - DNS zones

Click the button labeled "Add new DNS Zone with Wizard". This will bring up the DNS Zone Wizard:

ISPConfig - DNS - Create a new DNS zone

Here, fill in the fields as follows:

  • template: Leave it by default
  • Server: Select our server from the drop-down list.
  • Client: If the target web hosting is created under a client, set up the appropriate client here. But if you log in with that customer's user, it will be set up automatically.
  • Domain: Enter your new domain name (without www). For me, this is linuxportal.info.
  • IP address: When you click on the field, the server will offer the IP address of the server, select it.
  • NS 1: Set it here: ns1. . . (with me: ns1.linuxportal.info)
  • NS 2: Enter ns2 here. . -t. 
  • Email: This is where webmaster@domainnev.tld is used. In the future, please be aware that you will also need to create an account.
  • DKIM: This is fixed, so no action is required
  • Sign zone (DNSSEC): If we purchased the domain for our name DNSSECthen mark it

Ha minden megvan, mentsük az űrlapot. Ezután az ISPConfig beteszi az időzítőjébe a műveletet, fent megjelenik a piros kör, benne egy 8-as számmal (8 művelet a várólistában: 1 zóna fájl és benne 7 automatikusan létrehozott rekord). Tehát a következő cron ciklusban (percenként fut le) létrehozza a zónát és benne az alap rekordokat. Várjuk meg amíg eltűnik a piros kör. Eddig tehát megvan a DNS zónánk, egyelőre még nincs vele teendő.

 

Use of Secondary DNS Service

Now comes the key part of this tutorial, using the free secondary DNS service.

There are many service providers for this purpose, I used to be a BuddyNS I found it on a page called, and I use this for each of my domains here.

 

What you should know about them is that they provide 300.000 DNS retrieval every month for free per account. You can create any number of zones in an account. These hits are not equivalent to page views on a web page, but when the DNS servers update their zones or the primary DNS server is unavailable for some reason, they are still retrieved. My other low traffic pages (per piece) measure such monthly 45-60 thousand hits (out of the 300 thousand limit), so I still have plenty of room. However, it is a good idea to re-register for each new domain just so that they do not add up, but that we can take advantage of the free account per account.

 

In short, the essence of the service works is to enable the zone transfer option in the DNS zone on our own server, which allows this name provider to retrieve our DNS zone from the specified IP addresses. Then their server copies the zone and puts it in their own DNS servers, which are located in several parts of the world. This secures the remote secondary name server.

Let's get started. Register on the site Activate now link on their homepage.

BuddyNS - Registration

In the first field enter your email address, in the second your domain name and in the third the IP address of our server. Then I clicked on the ACTIVATE NOW button and immediately the email with the welcome message and the password I received was displayed. Also, sign in to our new account.

 

BuddyNS - Account

Right click on the ZONES menu to go to the zone information page.

BuddyNS - Zone information

Here, he writes first the mistakes and at the same time what to do to succeed. It prints three errors on the small panels on the right side of the page. Let's go through what needs to be done.

 

 

1. Error / Action: Could not read zone

"Could not fetch zone from See AXFR setup to fix this. "

This means that you do not have access to the zone on our server, so we need to enable zone transfer. I also linked the link in the error message here, click on it. This will bring up a page called "ENABLE AXFR TRANSFER TO BUDDYNS" where the integration solutions for the various control panels are listed on the left. Here you have to choose the one that suits you. I use ISPConfig, so this is a description of what I have not tried.

ISPConfig is not on this list, so scroll down and click Other.

BuddyNS - Zone Transfer Data

Here we see many IP addresses, including IPv6 addresses. Copy these addresses and e.g. in notepad, put them in a comma-separated row:

Update (2019-03-25)!
A few days ago, BuddyNS emailed me that this name server list was changing (infrastructure changes) so we would use the fresh ones.
Those who may have made the settings based on the description with their old addresses must make this change.
So the following image already contains the recent titles. I will no longer modify the other affected screenshots.

BuddyNS - List of Updated Name Servers (2019-03-25)

If our server does not have an IPv6 address then skip them!

Enter ISPConfig. Here we go to the DNS main menu, then select the appropriate DNS zone. Scroll down a bit here:

ISPConfig - Configure zone transfer

Copy the compiled row to the "Allow zone transfers to these IPs (comma separated list)" field in ISPConfig as shown in the image and save it. The red circle appears above, please wait while you make the changes.

Here we have now enabled the BuddyNS servers to retrieve our DNS zone. Let's go back to the BuddyNS page for error messages.

2. error / action: The BuddyNS name server is not declared in our zone

Error message:
“Zone does not declare BuddyNS as a nameserver. Clients query BuddyNS only if the registry does, making delegation inconsistent. See NS setup to fix this. "

Click on the link in the error message that takes you to the name servers:

BuddyNS - Selecting name servers

Lists their available name servers here. If you click on the button below, you will recommend the closest one to us. Scrolling down in the tutorials, the 3 name server recommends that so many are optimal. The first one is our own server, so here are two more nameservers to choose from. I choose Dutch and German:

j.ns.buddyns.com
c.ns.buddyns.com

Go back to ISPConfig and enter the DNS zone, then the Records tab at the top of the panel. Here are the records that ISPConfig automatically creates, which for me now looks like this:

ISPConfig - DNS Zone - Records

These records need to be expanded with a few more records so that our zone looks like this:

-----------------------------------------------------------------------------------
TYPE	NAME						DATA							PRIORITY	TTL
-----------------------------------------------------------------------------------
A		mail.linuxportal.info.		178.238.222.66					0			3600	megvan
A		linuxportal.info.			178.238.222.66					0			3600	megvan
A		ns1.linuxportal.info.		178.238.222.66					0			3600
A		szerver.linuxportal.info.	178.238.222.66					0			3600
A		www							178.238.222.66					0			3600	megvan
MX		linuxportal.info.			mail.linuxportal.info.			10			3600	megvan
NS		linuxportal.info.			c.ns.buddyns.com.				0			3600
NS		linuxportal.info.			ns1.linuxportal.info.			0			3600	megvan
NS		linuxportal.info.			j.ns.buddyns.com.				0			3600
TXT		linuxportal.info.			v=spf1 mx a ~all				0			3600	megvan

I highlighted in red the missing records that have yet to be created, a total of four pieces. I’m not taking a picture of every panel here right now because there would be a lot. So let’s fill our zone with the missing records. Of course, everyone has their own domain name and the IP address of their server. If the server has an IPv6 address, it also has an "AAAA" record, which ISPConfig offers in the same way when entering. If you do not have an IPv6 address, skip it.

Here, note that when you enter the record in the Hostname field, you need to put the domain name after. So where we enter our entire domain, it should end in a dot!
Additionally, the ns2 record created by default will either be deleted or changed to a buddyns name server. So the point is that there should be a total 3 ns record:
  • ns1.domainnevünk.tld.
  • c.ns.buddyns.com.
  • j.ns.buddyns.com.

Wait for ISPConfig to perform the requested operation (red circle). Once you're done, go back to the BuddyNS status page and update with F5:

BuddyNS - Zone status

It looks much better now. It will still display the previous error, but this will only disappear with the redirect of the domain name along with the last error.

 

3. error / action: Domain redirect

As a final task, log in to the registrar interface of your domain name and then redirect your domain there with name server redirection. Here are the three name servers:

  • 1. name server: the IP address of our server. Here it is important to specify the IP address of the server, not ns1.domainname.tld, as our domain name is still unknown to name servers.
  • 2. Name Server: c.ns.buddyns.com
  • 3. name server: j.ns.buddyns.com

There is no need to put dots at the end of names.

And now you have to wait for the net server name servers to update and take over the new data. This varies by service provider. It usually refreshes everywhere for 1-2 hours. In the meantime, we can observe the regcheck, there we will see the result of our work.

 

 

Create email accounts

Previously, the verification process that preceded a domain name redirect failed if we didn't have a mailbox named postmaster@domain.tld. That was the rule, so there must have been such a mailbox.

Now, during the setup process, I came across an article saying that you no longer need a postmaster account to redirect. Source.

So I left this step straight to the end because I was wondering if the redirect really works without the account. And indeed, the redirection was successful. So you no longer need a postmaster account. In fact, I don't even see the webmaster address given in the DNS zone in the regcheck. They used to write these before.

All of this was just as interesting as I was learning a new thing with this story.

 

upshot

Finally the DNS is updated and the page comes in.

The results:

BuddyNS - Successful status

This is what the BuddyNS interface looks like.

And the regcheck:

Domain ellenőrzés eredménye
Gratulálunk, a(z) linuxportal.info domain konfigurációjában nem talált hibát az ellenőrző procedúra.
Kérjük, ha bármi megjegyzése van írjon a hostmaster@....hu címre.
Az ellenőrző procedúra outputja: 
............................................................................... 
M-GREET -I- [linuxportal.info] Domi version 20170905 at 2018-04-26.10:43 
M-STAR -I- [linuxportal.info] NS parameter not given, getting it from DNS 
M-PNAM -I- [linuxportal.info] NS name: ns1.linuxportal.info 
M-PADD -I- [linuxportal.info] NS addr: 178.238.222.66 
M-ROK -I- [linuxportal.info] SOA parameters comply with RIPE 
M-NS -I- [linuxportal.info] A records for DNS servers: 
addr of NS ns1.linuxportal.info.: 178.238.222.66 
addr of NS c.ns.buddyns.com.: 88.198.106.11 
addr of NS j.ns.buddyns.com.: 185.34.136.178 
IPV6 addr of NS j.ns.buddyns.com.: 2A00:DCC7:D3FF:88B2:0:0:0:1 
IPV6 addr of NS c.ns.buddyns.com.: 2A01:4F8:D12:D01:0:0:10:4 
M-CSOA -I- [linuxportal.info] checking SOA at: ns1.linuxportal.info, 178.238.222.66 
M-CSOA -I- [linuxportal.info] checking SOA at: c.ns.buddyns.com, 88.198.106.11 
M-CSOA -I- [linuxportal.info] checking SOA at: j.ns.buddyns.com, 185.34.136.178 
M-TRNO -I- [linuxportal.info] skipping traceroute, servers on diff nets 178.238.222.66 88.198.106.11 
M-TRNO -I- [linuxportal.info] skipping traceroute, servers on diff nets 178.238.222.66 185.34.136.178 
M-NSC -I- [linuxportal.info] checking NS records ... 
M-SGET -I- [linuxportal.info] getting data from 88.198.106.11 c.ns.buddyns.com ... 
M-SGET -I- [linuxportal.info] getting data from 185.34.136.178 j.ns.buddyns.com ... 
M-OK -S- [linuxportal.info] All's well............ that ends well.................
...............................................................................

It's perfect, too.

 

So that would be setting up a secondary name server with external DNS.

 

The domain names, IP addresses, configuration settings and other information published in this description are public data accessible to anyone, and their publication does not violate any law.