Better IP Changing System

Marshall

Verified User
Joined
Nov 1, 2004
Messages
148
Location
California
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?
 
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
 
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.
 
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.
 
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
 
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.

Code:
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

Code:
Include /etc/httpd/conf/vhosts/*

Then a few days or weeks later you can delete the old configs from the vhosts directory.
 
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
 
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.
 
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
 
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.
 
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 :
Code:
|?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
                                                [COLOR="Red"]3600[/COLOR]
                                                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 :
Code:
|?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
                                                [COLOR="Red"]99[/COLOR]
                                                1209600
                                                86400 )

After this, nor problem with fr domains
 
Yes sure !

jlasman : you use 600 for TTL.
And for other values ?

I suppose something like this :
Code:
|?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 ?? )
 
I use 600 for all individual records, and the following for my soa record:
Code:
SERIAL NUMBER
1200
1800
604800
600
Jeff
 
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
Code:
SERIAL NUMBER
3600
1800
604800
600
 
Last edited:
Yes I know, but maybe someone reads this post, and I add some suggestions, working for me.
 
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:

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
 
Back
Top