Change of Static IP adress DNS server

Discussion in 'Installation/Configuration' started by Tastiger, Feb 23, 2017.

  1. Tastiger

    Tastiger Member

    Next week we are having our service upgraded to fibre (NBN here in Oz) and our static IP will change.
    I take it that I need to update the current ip address in all my DNS records to reflect the new static IP and then wait for it to populate?
    Oh and of course change the NS ip's with the with the companies that I bought the domain names from.

    Is there anything important or tips and tricks I need to know to make a smooth transition?
     
  2. ahrasis

    ahrasis Active Member

    First backup your ispc database.

    Then, at the relevant column - dns_rr(data) and server_ip(ip_address) (a) do search on the old ip and replace it with the new one online i.e. via phpmyadmin; or (b) by using a php script; or (c) download its database to do search and replace in your pc, then re-upload the newly changed database.

    Resync your ISPC afterwards.

    Note: You may refer to Dynamic IP Auto Updater, where we use a php script to change our ip dynamically as it changes from time to time. In that php script, other than the above suggested changes, we also change each and every ip address in /etc/bind/pri.*. Whether you should or should not change the old ip in /etc/bind/pri.* files, depends on whether ISPC will change the old ip in the said files upon full resync.
     
  3. Tastiger

    Tastiger Member

    Thanks for that - it is a static IP not a dynamic updater.
    However - I would have thought that the changes could be made via the IPConfig interface without touching the database? - see screen shot
    Are you saying there may be more references to the ip "hidden" in the database?

    Just want to make sure I get right first time....
     

    Attached Files:

    • dns.jpg
      dns.jpg
      File size:
      65.5 KB
      Views:
      10
  4. ahrasis

    ahrasis Active Member

    I noted. The given tips and tricks IS for IP changes, whether static or dynamic. And yes, you can also change all of it one by one, site by site in your ISPC. If you got only few sites, that will be short and easy. But if you got many sites, that gonna be tedious and take a lot of your time. Anyway, it is all up to you on how you gonna do it. I just shared my view on the how to. ;)
     
  5. Tastiger

    Tastiger Member

    Thanks for the clarification; I had a dry run of search on one of my daily DB backups and the SQL method looks like it may be a bit quicker than changing the IP through the ISPConfig interface, even though I only have 3 sites and its
    's good to know there is couple of ways to do it and hope that this thread will help someone in the future.
     
  6. Tastiger

    Tastiger Member

    I'll add one more thing to this for future reference, after changing everything with the database method, I found I had to go through and deactivate all email domains and then reactivate them to get mail working again.
    Thinking back now I have had to do the same thing anytime I have reinstalled the ISPConfig database from a backup.
     
  7. Tastiger

    Tastiger Member

    OK - looks as though the database method has gone and messed things right up, as stated before I had to disable and re-enable mail domains to get them to work.
    But .....
    I am no longer able to login to ISPConfig3 via https://server1.jones.dhs.org:8080/login/ or by using any of the domains, (XXX,com:8080) entering details just refreshes the page.


    I can get to the admin interface via https://server.jones.dhs.org:8080/index.php which seems really strange to me as it should not be doing that as the server is setup as per the tutorial for Ubuntu 16.04 on this site and all was functioning well prior to importing the database.

    On top of that none of my FTP accounts that connected to server1.jones.dhs.org are connecting - all other sites are fine.

    I am really not certain where to start looking to see what has happened
    - any clues?
     
  8. liane

    liane Member HowtoForge Supporter

    is it not what the resync tool is for?
     
  9. Tastiger

    Tastiger Member

    tried that - didn't seem to do anything, will try again, otherwise I am tempted to drop all DB tables and re import the edited sql file. Although I'm wary that the file may be the issue.
     
  10. liane

    liane Member HowtoForge Supporter

    I see in your previous screenshot you have some long TTLs (86400) for the DNS, perhaps it takes a long time to propagate? If you try a dig from your home, do you have the new IP or the previous one?
     
  11. Tastiger

    Tastiger Member

    new ip address showing for all sites
    server is:-
    id 36767
    opcode QUERY
    rcode NOERROR
    flags QR RD RA
    ;QUESTION
    server1.jones.dhs.org. IN A
    ;ANSWER
    server1.jones.dhs.org. 7199 IN A 110.141.196.223

    ;AUTHORITY
    ;ADDITIONAL

    so it does look like something has gone haywire in ISPC
    as I can reach phpmyadmin, webmin and the default site using server1.jones.dhs.org
     
  12. liane

    liane Member HowtoForge Supporter

    stupid question I'm sure, but since only web sites have problems, did you restarted apache?
    ISPC just controls conf files of other programs, it doesn't directly control apache, postfix pure-ftp bind etc... and since you used a find/replace on the SQL export, there is little chance you missed an IP, so either it didn't reflected all your changes in the respected conf files when the resync tool should have done it, or there is somewhere else in your system that need to be updated manually (like /etc/hosts for ex.)
     
  13. ahrasis

    ahrasis Active Member

    Remember that you need to change the IP address only in dns_rr(data) and server_ip(ip_address) columns and then resync ISPC (all services).

    Also note that: "Whether you should or should not change the old IP in /etc/bind/pri.* files, depends on whether ISPC will change the old IP in the said files upon full resync." That means, do check any of the said files after the resyc is fully completed because this won't work if any of the said files IP address is not changed to the new one.

    To sum up, the first part of the tips only affect IP address in the said two columns, and not the /etc/bind/pri.* files, as the later part of the tips depend on whether resync of ISPC is fully successfull. If the IP in any of the /etc/bind/pri.* files are still the old IP, you may need to change them all to new IP and resync all services in ISPC again.

    The above is most probably due to your cookies which you should clear before testing your websites or you may use other browsers to test them.

    I also note your SSL is a self-signed, so it is advisable to upgrade it. A link in my signature will direct you on how to secure your server with the free Let's Encrypt SSL which is now one of the great feature of ISPC.

    Other than that, as stated by @liane - dns propagation do take sometimes and restarting apache is also advisable.
     
  14. Tastiger

    Tastiger Member

    Thanks for your input so far,
    Just to clarify -
    Server has been restarted a few times
    websites are not giving me an issue - all 3 live sites sites setup in ISPC on the server are resolving fine and working.
    server1.jones.dhs.org resolves correctly to the default page setup when server was installed, as does jones,dhs.org
    email appears fine
    all FTP accounts are fine except those that access server1.jones.dhs.org
    /etc/bind/pri.* - all show new IP address
    Cookies cleared before try login ISPC
    etc/hosts is showing the original setup
    Code:
    127.0.0.1    localhost
    10.0.0.11    server1.jones.dhs.org    server1
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    as stated Webmin, phpMyadmin, all load fine using server1.jones.dhs.org
    So it is only ISPC that refuses to allow me to login via https://server1.jones.dhs.org:8080 or https://[VHOST]:8080 and those 2 FTP accounts. but I can access ISPC via https//server.jones.dhs.org and I cannot find out where it is pulling the "server" prefix from rather than "server1"
    The mystery deepens - I will now setup the certificates and see if that has any effect.
    If that doesn't help I may have to do a roll back the server state as it was a couple of hours before our IP changed and then manually change the IP addresses but I'd like to avoid that if at all possible.
     
  15. Tastiger

    Tastiger Member

    well now I can login using any of the vhosts addresses but all mail seems to have stopped working - what a night mare this has turned out to be
     
  16. ahrasis

    ahrasis Active Member

    I am sure that the tips given doesn't affect any postfix (mail) settings but IP address of your DNS and server settings only. It also doesn't affect your static system IP address. You can dig your website mx records to check whether they are having the correct new IP address but I doubt that is causing your mail failure.
     
  17. Tastiger

    Tastiger Member

    Bah I gave up and reinstalled the whole damn thing
     
  18. ahrasis

    ahrasis Active Member

    Sorry to hear that. Good luck then.
     

Share This Page