Question about ip sequence in /var/named/domain.db

gospodinov

New member
Joined
Apr 19, 2020
Messages
3
Hello, i have 2 ip addressess in my server. First one is prefered ip and second one is backup, i have made some changes in named so it returns results as sequence created in /var/named/domain.db but when i made some change (add subdomain, etc...) the script always turns the ip sequence.
To become more clear i will give example :
IP1 = 1.1.1.1
Backup IP = 2.2.2.2

domain.db should look like this :
www 14400 IN A 1.1.1.1
www 14400 IN A 2.2.2.2

But when i add subdomain it looks like this :
www 14400 IN A 2.2.2.2
www 14400 IN A 1.1.1.1

Any ideas what to do so it always make IP1 first and Backup IP second ?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
5,287
Location
Maastricht
First of all, never change /var/named/ database files manually.

Second I gues you're doing it the wrong way. When there are 2 records for the same thing like www, how dus DNS know how to use which ip?
You say it's backup, but if DNS is running on ip 1.1.1.1. it can't find ip 2.2.2.2 anymore either when the ip goes down. You don't need backups this way and I might be mistaken, but I'm almost sure it will not work this way.

If you want a kind of redundancy you need to have another server which a secondary DNS which can catch up things for you.
 

gospodinov

New member
Joined
Apr 19, 2020
Messages
3
First of all, never change /var/named/ database files manually.

Second I gues you're doing it the wrong way. When there are 2 records for the same thing like www, how dus DNS know how to use which ip?
You say it's backup, but if DNS is running on ip 1.1.1.1. it can't find ip 2.2.2.2 anymore either when the ip goes down. You don't need backups this way and I might be mistaken, but I'm almost sure it will not work this way.

If you want a kind of redundancy you need to have another server which a secondary DNS which can catch up things for you.
Richard, this config working fine, tested without internet on 1.1.1.1 and still working fine i have made required configuration for this. The only problem is IP sequence. I want IP1 to become first in /var/named/domain.db. Any ideas ?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
5,287
Location
Maastricht
Oke when you say it's fine I'll go with that.

I presume that the 1.1.1.1 ip which you want first, is also setup as primary ip on the server and 2.2.2.2. is installed as secondary ip.

The only thing I can thing of next, is maybe the ip's are present in the wrong order physically, like here:
/usr/local/directadmin/data/admin/ip.list
if they are in the correct order there too, then I'm sorry, somebody else has to help you or maybe you can send in a ticket.
 

gospodinov

New member
Joined
Apr 19, 2020
Messages
3
I tried changing order in
/usr/local/directadmin/data/admin/ip.list
and still same...
 
Top