How to Lookup a CNAME via SSH

In this tutorial, we will show you how to lookup a CNAME record using SSH. This can be an important step when troubleshooting redirect issues. Performing this test via SSH can save time, since it can be done right in a terminal. We also have a helpful guide on how to create a CNAME record.

CNAME Lookup

  1. Login to your server via SSH.
  2. Run the following CNAME lookup command. Be sure to replace example.com with the domain you want to check.

    host -t cname example.com

    You should see a response similar to this, but it will differ based on the specific domain.

    example.com is an alias for test.travelworld58.com.

    In this example, you see the domain is an alias of another URL. If the domain does not have a CNAME you will see the following result:

    example.com has no CNAME record

Congratulations, now you know how to lookup a CNAME record using SSH!

Leave a Reply