SecurityTrails Blog · Jan 30 · by Esteban Borges

Using DNSTrails to move servers

Reading time: 3 minutes

Our DNS tool can help in your SysAdmin and DevOps tasks while migrating from one server to another, especially when you have lots of “dead” domains on these hosts.

Some time ago we wrote a blog post about how useful was DNSTrails to recover lost DNS records after moving websites from one server to another. This was a useful showcase on what to do when DNS propagation already finished and you have nowhere to look into to find out the IP value of your previous DNS records.

That was just a quick, minimal look into the full potential of DNSTrails. Our fantastic DNS tool can help you even further in your SysAdmin and DevOps tasks while migrating from one server to another, especially when you have lots of “dead” domains on these hosts.

Traditional migrations are from one single server IP to another. In most cases, you don't need to move your sites across multiple IPs. However, let's suppose you need to move all your websites, and each one of them has a dedicated IP (SEO and SSL often require having one dedicated IP per website), so you will need to assign each one of them to multiple IPs in one single server move.

While migrating, all you need to focus on is avoiding mistakes while changing the DNS records on each DNS zone that may cause downtime. And sometimes you have many IPs and domains pointed to a server, many of which could have already expired.

In this case, you can use the historical DNS database to retrieve old values after migrating, or pick up the new IP address value as well. This will be useful in case you set the wrong IP, or just to have full control over the DNS propagation to the new server.

Fetching data using IPv4 Explorer & Search Domain endpoints from our API

You can even start using our powerful API to retrieve values before and after the migration is done.

Using the IPv4 Explorer and Searching Domains from our API should give you the ability to retrieve useful information regarding all the new IPs from your new server.

Our IPv4 explorer can help you to find all the migrated IPs by finding IP neighbors on the same network/server. Just include specific IP address and let us do the magic with our API.

As you see below in the next example using curl command:

[webtech@localhost ~]$ curl -s --header "APIKEY: $APIKEYHERE" 'https://api.securitytrails.com/v1/explore/ip/137.254.120.0?mask=24' | jq -C

Make sure you replace $APIKEYHERE with your real API key. Contact us if you don't have one yet!

The result will show something like this:

{
  "blocks": [
    {
      "sites": 0,
      "ip": "137.254.120.0/28",
      "current": true
    },
    {
      "sites": 3,
      "ip": "137.254.120.16/28"
    },
    {
      "sites": 0,
      "ip": "137.254.120.32/28"
    },
    {
      "sites": 11,
      "ip": "137.254.120.48/28"
    },

Then, you can use our API Searching Domains endpoints to find out which domains are responding to certain IPs (ipv4 or ipv6), as it will filter and fetch any data from the DNS records after migration, as you see below:

curl -s \
     --request POST \
     --header "Content-Type: application/json" \
     --header "APIKEY: $APIKEYHERE \
     --data-binary "{
  \"filter\": {
    \"ipv4\": \"137.254.120.50\"
  }
}" \

'https://api.securitytrails.com/v1/search/list/' | jq -C

The output should be similar to this:

Result

More examples of how you can interact with our API can be found in our official API Documentation.

As you can see, you can easily build an app that can control the IP values to ensure no errors are made during the server migration and that all IPs match the new ones, and, should an error occur in the process, enables you to act quickly to solve it and avoid any website problems.


Are you ready to start using our API? Contact us to request access today!

Esteban Borges Blog Author
ESTEBAN BORGES

Esteban is a seasoned cybersecurity specialist, and marketing manager with nearly 20 years of experience. Since joining SecurityTrails in 2017 he’s been our go-to for technical server security and source intelligence info.

Subscribe to the SecurityTrails newsletter
Sign up for our newsletter today!

Get the best cybersec research, news, tools,
and interviews with industry leaders

×