We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
DNS stop working after 99 DNS record change per day
DNS stop working after 99 DNS record change per day
(sory for bad english, not my first language, and a long day at work !)
Hello,
I leave this post because i found a 'bug'. I pose here the problem, the analysis, and the resolution. If a VestaCP developer could incorporate the modification in the source code, it would be useful for many of us!
The problem:
During massive transfer of some of my servers, I have a script that modify DNS configuration record by record on the fly. After a while, the DNS server was falling down, and I had to completely remove the DNS from the domain to recreate it.
Origin of the bug :
After analysis, I concluded that it is the 'serial' attached to the DNS record that was involved. Serial format is YYYMMDDXX where XX is a number incremented each time the DNS configuration is changed. In conclusion, you can not make more than 99 DNS change in one day on a domain.
Solution:
In order to overcome this, I made the following changes:
in file /usr/local/vesta/func/domain.sh :
in function update_domain_zone()
Replace :
By :
and replace function update_domain_serial() by this one :
You will be abe to make up to 9999 DNS change per day and per domain
Hoping it will help !
----------------------
Having issues with your server ? contact me !
Pierre-Guillaume - MathsiMo
Hello,
I leave this post because i found a 'bug'. I pose here the problem, the analysis, and the resolution. If a VestaCP developer could incorporate the modification in the source code, it would be useful for many of us!
The problem:
During massive transfer of some of my servers, I have a script that modify DNS configuration record by record on the fly. After a while, the DNS server was falling down, and I had to completely remove the DNS from the domain to recreate it.
Origin of the bug :
After analysis, I concluded that it is the 'serial' attached to the DNS record that was involved. Serial format is YYYMMDDXX where XX is a number incremented each time the DNS configuration is changed. In conclusion, you can not make more than 99 DNS change in one day on a domain.
Solution:
In order to overcome this, I made the following changes:
in file /usr/local/vesta/func/domain.sh :
in function update_domain_zone()
Replace :
Code: Select all
if [ -z "$SERIAL" ]; then
SERIAL=$(date +'%Y%m%d01')
fi
Code: Select all
if [ -z "$SERIAL" ]; then
SERIAL=$(date +'%y%m%d0001')
fi
Code: Select all
update_domain_serial() {
zn_conf="$HOMEDIR/$user/conf/dns/$domain.db"
if [ -e $zn_conf ]; then
zn_serial=$(head $zn_conf |grep 'SOA' -A1 |tail -n 1 |sed "s/ //g")
s_date=$(echo ${zn_serial:0:6})
c_date=$(date +'%y%m%d')
if [ "$s_date" == "$c_date" ]; then
cur_value=$(echo ${zn_serial:6} )
new_value=$(expr $cur_value + 1 )
len_value=$(expr length $new_value)
if [ 1 -eq "$len_value" ]; then
new_value='000'$new_value
fi
if [ 2 -eq "$len_value" ]; then
new_value='00'$new_value
fi
if [ 3 -eq "$len_value" ]; then
new_value='0'$new_value
fi
serial="$c_date""$new_value"
else
serial="$(date +'%y%m%d0001')"
fi
else
serial="$(date +'%y%m%d0001')"
fi
add_object_key "dns" 'DOMAIN' "$domain" 'SERIAL' 'RECORDS'
update_object_value 'dns' 'DOMAIN' "$domain" '$SERIAL' "$serial"
}
Hoping it will help !
----------------------
Having issues with your server ? contact me !
Pierre-Guillaume - MathsiMo
Last edited by pggj on Tue Sep 08, 2020 7:57 pm, edited 1 time in total.
Re: DNS stop working after 99 DNS record change per day
Hello!, please change this error:
for:
Thank you!, I really appreciate your work.
Code: Select all
if [ 1 -eq "$len_value" ]; then
new_value=000'$new_value
Code: Select all
if [ 1 -eq "$len_value" ]; then
new_value='000'$new_value
Re: DNS stop working after 99 DNS record change per day
Thank you for this corection, I directly modified the post :)
Re: DNS stop working after 99 DNS record change per day
Nice work, not much people make 99 changes in one domain per day but its ok
I recomend you make a pull request in github or open same issue in github
I recomend you make a pull request in github or open same issue in github