Forward all domain queries to new server

  • Hi,


    I would like to move my old server to a new server next monday. (server i-mscp version: 1.3.1)
    After I move all domains etc, I would like to forward all DNS queries from old server to my new server's IP.


    Why?
    1. Some domain nameserver changes take a lot of time, so I would like to forward all DNS queries to new IP.
    2. Some domain is not my handling, so my clients need some time to update their own domain's nameservers.


    Is it possible somehow?


    And other question:
    Can I change the default TTL for all domain temporarly? (for faster IP update)


    Thank you!

    i-MSCP 1.5.3
    Plugins (latest version): ClamAV, CronJobs, DomainAutoApproval, LetsEncrypt, OpenDKIM, PanelRedirect, PhpSwitcher, PolicydSPF, Postgrey, RecaptchaPMA, RoundcubePlugins, SpamAssasin, WHMCS

  • On your old server run the following:

    Code
    1. sed -i 's/192.168.1.1/172.16.16.1/g' /var/cache/bind/*.db
    2. sed -i 's/192.168.2.1/172.16.17.1/g' /var/cache/bind/*.db
    3. service bind9 restart

    Where:
    - 192.168.1.1 is your primary OLD IP Address
    - 192.168.2.1 is your secondary OLD IP Address
    - 172.16.16.1 is your primary NEW IP Address
    - 172.16.17.1 is your secondary NEW IP Address


    So, all the DNS queries performed against your OLD server, will receive the new IP addresses as answers.


    Hope it helps,
    bye Kess.

  • @kess


    Hmm... That will not solve propagation issues. Those records can be cached on other DNS servers... Also, when changing something in a zone file, you must also update the serial ;) You should really avoid giving such sed command <X


    Can I change the default TTL for all domain temporarly? (for faster IP update)

    No, you cannot do that. TTL is also cached. changing it would have no impact on propagation time.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Nuxwin Yes i know, you are right.
    In fact generally you change TTL at least 2 weeks before the beginning of the server move, to the lowest accepted value.


    But as I can understand @Dylan is a little bit late now, and he is going to have problems for sure.
    What I implemented, simply resolves the queries done against the old DNS, with the new IP addresses. This has nothing to do with "propagation speed up". It's just a really dirty workaround in order resolve some parts of the problem.


    The rest, is cached somewhere in multiple parts of the internet, where you have no control... So... Just wait...

  • I used iptables in such case. first migrated customer data, then redirected traffic for service ports to new server ip.
    do this on your old server:


    when your dns is propagated, you can remove those rules or disable your old server