View Full Version : Better IP Changing System
Marshall
04-12-2007, 01:19 PM
I was changing a domain's IP address in directadmin earlier and noticed that when I went to the domain after the change, I got the default apache installation page. I looked into the user's httpd.conf and saw it completely removed the old IP virtualhost for the new one but my DNS servers at my ISP were still cached to the old one. I manually input the old IP with the same info and the website came back up for me using my ISP cached IPs.
My request is that something like this be setup in DA where, after changing an IP, it keeps the old IP information and adds the new IP information. Then, about 1-2 days later from matching the change date/time stored somewhere in a DA file to the current server date/time, it recreates the httpd.conf for that user and removes the old IP information from it.
This would be really helpful when you have a domain that wants to add SSL and has already been hosted for a bit so that they don't have any downtime during the IP change.
Anyone else want something like this?
nobaloney
04-15-2007, 03:02 PM
Can httpd host two virtual hosts for the same domain name? I don't think so.
Can it alias two IP#s to the same virtual host? I'm not sure how.
Exactly what change did you make?
Jeff
Marshall
04-15-2007, 03:46 PM
I went to the httpd.conf inside the /usr/local/directadmin/data/users/*username* directory and editted that. I copied the virtualhost for the new ip:80 and pasted it above it and changed it to the old ip, saved and restarted httpd and the site reappeared on the old IP as well as for computers that had it as the new IP.
floyd
04-16-2007, 05:49 AM
Can httpd host two virtual hosts for the same domain name?
Yes it can. Been doing it for years whenever I needed to change ip addresses. I do exactly what Marshall did in his last post.
nobaloney
04-24-2007, 10:20 AM
A belated thanks, Floyd.
Does DA choke on it in any way?
If this is implemented I'd like it to be optional (sometimes you're removing an IP# from a server and that's why you're changing the IP# for a domain).
Jeff
floyd
04-24-2007, 10:34 AM
What I had done personally in the past, long before I had DA and since I had a lot of vhosts and didn't want to clutter the httpd.conf file, I created /etc/httpd/conf/vhosts and put all my vhosts in there and included that directory in the main httpd.conf file.
Include /etc/httpd/conf/vhosts/*
So now what I do before changing an ip in DA I copy the users httpd.conf file from /usr/local/directadmin/data/users/username/httpd.conf to /etc/httpd/conf/vhosts/username.conf. DA doesn't complain because it doesn't know its there. Only apache knows its there and loads it. Just make sure you have
Include /etc/httpd/conf/vhosts/*
Then a few days or weeks later you can delete the old configs from the vhosts directory.
DirectAdmin Support
04-24-2007, 05:39 PM
The only problem I can see is if you move one user off an IP, so that you can convert it to be an owned IP for someone else. A VH that lingers around might cause confusion if it isn't supposed to be on that IP.
It may be easier... to use
<VirtualHost *:80>
instead of:
<VirtualHost 1.2.3.4:80>
for a short period so it's purely named based hosting, no IPs involved. Not sure if that will work ... if it overlaps owned IPs..etc. (not tested).
A related guide, you can also lower your TTL prior to the change to minimize the effects of this:
http://help.directadmin.com/item.php?id=87
John
Marshall
04-24-2007, 06:15 PM
Thats true about lingering on the IP, maybe put a checkbox next to the dropdown asking if you want a temporary host made for old IP so that you can choose not to have it made.
The TTL thing is nice but there is still some downtime and waiting to make sure every nameserver around has updated to the new TTL when doing that and the IP system would make downtime practically 0 and users will be able to change IPs on the fly without having to wait for new TTLs to take effect.
nobaloney
04-24-2007, 06:32 PM
A related guide, you can also lower your TTL prior to the change to minimize the effects of this:
http://help.directadmin.com/item.php?id=87
For what it's worth, John, I've been using a ttl of 600 seconds (ten minutes) on all my webhosting servers for at least ten years now.
Years ago I'd get complaints from time to time from so-called Internet police (we called them "Internet Nazis"), but I haven't heard any complaints in many years.
Also, many registrars now install new nameservers in the gtld servers almost instantly, as opposed to twice a day, 6am and 6pm (EST) many years ago.
Jeff
Chrysalis
04-25-2007, 12:07 AM
I also use 600 for as long as I can remember, some isps of course dont honour it and cache for longer but on the whole I havent had any complaints.
pppplus
12-31-2010, 09:26 AM
A related guide, you can also lower your TTL prior to the change to minimize the effects of this:
http://help.directadmin.com/item.php?id=87
Be carefull with .fr domain. There is a problem !
After the change of TTL with this how to, we have our template like this :
|?NS_TIME=100|
|?A_TIME=100|
|?MX_TIME=100|
|?CNAME_TIME=100|
|?PTR_TIME=100|
|?TXT_TIME=100|
|?AAAA_TIME=100|
|?SRV_TIME=100|
$TTL 100
@ IN SOA |NS1| |EMAIL| (
|SERIAL|
100
3600
1209600
86400 )
Afnic rejects new configuration with this message :
Le champ 'retry' doit être inférieur à celui du 'refresh'
* Réf: IETF RFC1912 (p.4)
The 'retry' value is typically a fraction of the 'refresh' interval.
* La valeur du champ 'retry' est de 3600 sec, et devrait être inférieure au 'refresh' (100 sec).
So the problem is 3600 is not lowest than 100
So you have to modify like this for example :
|?NS_TIME=100|
|?A_TIME=100|
|?MX_TIME=100|
|?CNAME_TIME=100|
|?PTR_TIME=100|
|?TXT_TIME=100|
|?AAAA_TIME=100|
|?SRV_TIME=100|
$TTL 100
@ IN SOA |NS1| |EMAIL| (
|SERIAL|
100
99
1209600
86400 )
After this, nor problem with fr domains
nobaloney
12-31-2010, 05:37 PM
Don't forget to change it back afterwards.
Jeff
pppplus
01-01-2011, 02:31 AM
Yes sure !
jlasman : you use 600 for TTL.
And for other values ?
I suppose something like this :
|?NS_TIME=600|
|?A_TIME=600|
|?MX_TIME=600|
|?CNAME_TIME=600|
|?PTR_TIME=600|
|?TXT_TIME=600|
|?AAAA_TIME=600|
|?SRV_TIME=600|
$TTL 600
@ IN SOA |NS1| |EMAIL| (
|SERIAL|
600
599 ??
1209600 ??
86400 ?? )
nobaloney
01-02-2011, 05:35 PM
I use 600 for all individual records, and the following for my soa record:
SERIAL NUMBER
1200
1800
604800
600
Jeff
pppplus
01-03-2011, 01:41 AM
Ok, thanks.
Except that it is not "logical" for .fr (but maybe it is the only one extension with this problem), because 1200<1800
+ And minimum retry for .fr is 1 hour
So I put and it works perfect, without warning
SERIAL NUMBER
3600
1800
604800
600
nobaloney
01-03-2011, 12:08 PM
You didn't ask what would work for you; you asked what I use :).
Jeff
pppplus
01-03-2011, 12:21 PM
Yes I know, but maybe someone reads this post, and I add some suggestions, working for me.
layer0
01-13-2011, 05:52 AM
For what it's worth, John, I've been using a ttl of 600 seconds (ten minutes) on all my webhosting servers for at least ten years now.
Doesn't this increase the number of DNS lookups your nameservers have to handle, and also delay loading time for your domains as the DNS needs to be re-queried every 10 minutes?
zEitEr
01-13-2011, 11:06 AM
ISP's recursive/cache DNS servers sometimes ignore that time. And keep it in cache much more longer.
nobaloney
01-13-2011, 04:45 PM
@zEitEr:
Testing years ago showed that 600 didn't get ignored. Perhaps your experience has been different.
@layer0:
Yes, it increases the DNS lookups. But DNS lookups are only one packet in each direction, so it shouldn't increase it noticeably.
Everyone:
DNS services employed by people who post on dynamic IP#s use an even lower TTL.
Jeff
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.