Press "Enter" to skip to content

Posts published in August 2021

How to use NSlookup commands

NSlookup is a built-in software that allows you to query domain name servers.

NSlookup commands can be used on most typical OSes like Windows, macOS, and Linux (Ubuntu, CentOS, Debian, etc.). Now you will see what is it, and how to you it?

How to start the NSlookup command?

For Windows

1. Press Windows key + the letter “R”. This will start the run application.

2. Write “cmd” and press “ok”.

3. Now, you are ready to use NSlookup command. See the examples below.

For macOS

1. Press the command button + Spacebar button.

2. Type the name of the app – Terminal.

3. Ready to write NSlookup commands.

Nslookup: command not found – how to fix it?

Examples of how to use Nslookup commands:

Use these examples with the domain you like by changing the domainname.com with the one you like. The same goes for the IP addresses used in the examples. 

Use the NSlookup to see the domain’s IP address:

nslookup domainname.com

This will show you the data from the A and AAAA records of the domain. There you can see the IPv4 and IPv6 addresses.

Check specific DNS type of record with the following:

nslookup -type=TYPE domainname.com 

You can change TYPE with the type of DNS record you want to query like: A, AAAA, MX, SOA, NS, ANY (any type available). 

nslookup -type=a domainname.com – shows you the IPv4 addresses of the domain.

nslookup -type=aaaa domainname.com – shows you the IPv6 addresses of the domain. 

nslookup -type=mx domainname.com – shows you the MX records, and you can see the responsible email servers for receiving emails. 

nslookup -type=soa domainname.com – shows you the start of authority. 

nslookup -type=ns domainname.com – shows you the name servers available. 

nslookup -type=any domainname.com – shows you all of the DNS records available. 

Check a specific name server.

After you have seen all of them with the NS query, you can now probe each individually. 

nslookup domainname.com ns1.domainname.com

Change ns1.domainname.com with one of the name servers for your domain. 

Check an IP address (Reverse DNS lookup)

You can also probe an IP address and see if there is a PTR record set in a Reverse DNS zone. 

nslookup 111.111.111.111

Change the 111.111.111.111 IP address with the one you want to verify. It can be IPv4 or IPv6 address. 

Learn more about rDNS

Nslookup check of a particular port for communication.

You can also use the NSlookup to check a server through a particular port. In this case, we will use port 53. Change it with another if you like. 

nslookup -port=53 domainname.com

Give a particular time limit to wait for the response.

You can set the waiting period, in seconds, for the queries. Let’s set it to 35 seconds in this example. You can set it to another period. 

Nslookup -timeout=20 domainname.com

Nslookup debug mode enable 

nslookup -debug domainname.com

Conclusion

The NSlookup command is a very used tool because it is easy to find on different devices and works the same. It doesn’t have so much different behavior on the different Oses like some other network tools. 

The Nslookup command can help you check your domain name and see problems with your DNS.

Error 502 Bad Gateway – 5 quick fixes

What does Error 502 Bad Gateway mean?

Error 502 Bad Gateway is a HTTP status code. It is a general pointer that there’s something that is not right with a website’s server communication. 

This status code shows that the server, while serving as a gateway or proxy, received an invalid response from an inbound server it accessed while trying to achieve the request.

If you want to visit a website on the Internet, your browser sends a request to a server connected to the web. This server receives the request and applies a process to deliver back the resources you demanded, including an HTTP header and an HTTP status code.

In case everything works, users are not going to see the HTTP status code. Simply, this is the way servers interact with each other. However, if something fails, the server will inform you with exactly this code.

Error 502 Bad Gateway can be displayed like:

  • 502 Bad Gateway
  • Temporary Error (502)
  • HTTP 502
  • 502 Proxy Error
  • 502 Service Temporarily Overloaded
  • 502 Server Error: The server faced a temporary error and is not able to complete your request.
  • Bad Gateway: The proxy server got an invalid response from an upstream server.

Let’s observe some of the quick fixes that could help you. 

Reload the page.

The first thing you could try when you face an Error 502 Bad Gateway is simply to wait a moment and reload the page. Of course, the host or the server could be just overloaded. If it is so, the website should come right back.

Also, another thing to quickly try is opening the website through a different browser. 

You can find platforms that can check if the website is actually down or the problem is on your side.

Remove Your Browser Cache

If the error continues, it could be the possibility that your browser cache holds outdated and corrupted data. If this is the case, you should clean the browser cache to fix this error.

It is important to know that removing the cache might lead to losing some essential browser data or bookmarks and preferences, which you set. Therefore, you should export your data from the browser, and after you finish removing the cache, import it back to prevent losing data.

Check for any DNS changes.

A possible reason for facing Error 502 Bad Gateway could be a DNS issue. For example, the domain does not reveal the right IP. 

It is necessary to be patient for things to completely propagate, in case you recently migrated your website to a new host. The required time depends on the TTL value of your DNS records.

Briefly Disable Firewall or CDN

Perhaps there could be an issue with your firewall or Content Delivery Network (CDN). In case you are using a provider of CDN, you can simply disable your CDN for a moment. Then you can test to reach your website again. 

This error is possible to occur sometimes with providers of DDoS protection and mitigation or fully proxy services. This is because they hold an extra firewall in-between. It can often happen if you are using a free plan. 

Suggested article: Error 404 – how to fix it?

Reach your host.

In case you can’t solve the problem on your own, give a call to your host company. They can observe what is going on and deliver more information about the situation.

Perhaps the issue could be on their end, and they could be able to fix it easily. They can also help if the problem is particularly associated with your website.