• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

test

Troubleshoot Nameservers with Dig

April 8, 2021

Here’s how to troubleshoot nameservers with dig.

dig hostname
dig domain.com

dig hostname dig domain.com

To test a specific nameserver.

dig @nameserver hostname
dig @nameserver ip-address

dig @nameserver hostname dig @nameserver ip-address

Other options.

dig hostname.domain.com +short
dig hostname.domain.com +noall +answer
dig @nameserver MX domain.com
dig @nameserver AAAA domain.com

dig hostname.domain.com +short dig hostname.domain.com +noall +answer dig @nameserver MX domain.com dig @nameserver AAAA domain.com

Filed Under: Linux Tagged With: dig, nameservers, test, troubleshoot

Use Curl on Load Balancers

December 18, 2019

You can use the curl command to test if your load balancer is working as expected. The curl command will alternately and randomly access several instances in your load balancer. If you have 3 instances behind your load balancer, it will be cycled across all 3. The -m1 command means max time is set to 1 second.

while true; do curl -m1 [IP_ADDRESS]; done

while true; do curl -m1 [IP_ADDRESS]; done

Filed Under: Cloud Tagged With: aws, curl, gcp, load balancer, test

Testing a Network Port Connection

October 10, 2018

You can test a network port connection using the “nc” command on Linux and “telnet” on Windows.

Format:
$ nc -zv domain.com port
C:\> telnet domain.com port

$ nc -zv domain.com 80
Connection to domain.com 80 port [tcp/http] succeeded!

$ nc -zv domain.com 80 Connection to domain.com 80 port [tcp/http] succeeded!

C:\> telnet -zv domain.com 80
Connecting To domain.com...Could not open connection to the host, on port 80: Connect failed

C:\> telnet -zv domain.com 80 Connecting To domain.com...Could not open connection to the host, on port 80: Connect failed

For Telnet, if a connection is successful, it returns no message.

Filed Under: Cloud, Linux Tagged With: connection, nc, port, telnet, test

Check DB Connection on AWS

December 3, 2017

When setting up your cloud infrastructure, you can check if your instances have access to the database by performing this command.

$ nc -zv 10.0.0.45 3306
$ nc -zv domain.com 3306
$ nc -zv endpoint.amazonaws.com 3306

$ nc -zv 10.0.0.45 3306 $ nc -zv domain.com 3306 $ nc -zv endpoint.amazonaws.com 3306

If connection has succeeded, you’ll get a message like this in Linux and MacOS …

Connection to endpoint.amazonaws.com 3306 port [tcp/mysql] succeeded!

Connection to endpoint.amazonaws.com 3306 port [tcp/mysql] succeeded!

On Windows, you can use Telnet to test your DB connection.

C:\>telnet endpoint.amazonaws.com 3306

C:\>telnet endpoint.amazonaws.com 3306

If connection has succeeded, the result is “no message.” If there’s a problem, you’ll get this ….

Connecting To endpoint.amazonaws.com...Could not open 
connection to the host, on port 3306: Connect failed

Connecting To endpoint.amazonaws.com...Could not open connection to the host, on port 3306: Connect failed

Filed Under: Linux Tagged With: connection, database, test

  • Home
  • About
  • Archives

Copyright © 2023