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.

    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:

    1. sed -i 's/' /var/cache/bind/*.db
    2. sed -i 's/' /var/cache/bind/*.db
    3. service bind9 restart

    - is your primary OLD IP Address
    - is your secondary OLD IP Address
    - is your primary NEW IP Address
    - 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.


  • @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