跳至内容

DNS not resolving / Nodejs App doesn't open on browser with subdomain

0

I have deployed a small testing nodejs application on Lightsail. I got Public IPv4 adress. I added an A record in my cPanel with a subdomain pointing to this IP. I also changed the bitnami.config file to proxypass and proxy pass reverse with http://localhost:3001. I dont have SSL certificate for this subdomain or IP. Now when I open myIP:3001 in browser, it servers my NodeJs Applicatio, but when I open my subdomain, it gives me this error

This site can’t be reached
Check if there is a typo in app.jobdrive.ai.

If spelling is correct, try running Windows Network Diagnostics.
DNS_PROBE_FINISHED_NXDOMAIN

I waited for 48 hours for DNS to propagate, but still same issue. And have checked common errors like correct subdomain name, correct IP address. Looking forward to solutions. Thanks

已提问 1 个月前24 查看次数
2 回答
0

Based on your description, there are several potential issues that could be preventing your subdomain from resolving correctly:

  1. DNS Configuration: While you mentioned adding an A record in cPanel pointing to your Lightsail instance's IP address, there might be an issue with how the DNS record is configured. Make sure that:
  • The A record is correctly formatted with no typos
  • There are no conflicting CNAME records for the same subdomain
  • The subdomain is properly formatted in the DNS record
  1. Name Server Configuration: Ensure that your domain's name servers are correctly configured. If you're managing DNS through cPanel but your domain should be using different name servers, this could cause resolution problems.

  2. Web Server Configuration: You mentioned changing the bitnami.conf file for proxy settings, but there might be additional configuration needed:

  • Verify that your web server (likely Apache or Nginx) is configured to respond to requests for your specific subdomain
  • Check that the virtual host configuration includes your subdomain name
  • Ensure the proxy settings are correctly forwarding traffic to your Node.js application
  1. Firewall/Security Group Settings: Confirm that your Lightsail instance's firewall settings allow incoming traffic on the necessary ports (typically 80 for HTTP and 443 for HTTPS).

  2. Application Configuration: Make sure your Node.js application is configured to accept connections from external sources, not just localhost.

To troubleshoot further:

  1. Use the dig command to check if your subdomain is resolving correctly:
dig +trace app.jobdrive.ai

This will show you the DNS resolution path and help identify where the problem might be.

  1. Check your web server's error logs for any issues related to your subdomain.

  2. Verify that your Node.js application is running and accessible on port 3001.

  3. If you're using a reverse proxy configuration, ensure it's correctly set up to forward requests to your Node.js application.

The "DNS_PROBE_FINISHED_NXDOMAIN" error specifically indicates that the DNS lookup for your subdomain is failing, suggesting the issue is likely at the DNS configuration level rather than with your application or server configuration.
Sources
DNS issues. Loads by IP not Name. | AWS re:Post
Troubleshoot DNS resolution issues for records in Route 53 public hosted zones | AWS re:Post
Suddenly the domain connection fails. | AWS re:Post

已回答 1 个月前
0

A DNS record for the root domain (ex. example.net) won't resolve the sub-domains. If you have a sub-domain (app.example.net) you would also need an A record or CNAME record that resolves for that sub-domain. Even when you add the records there may be some propagation delay.

AWS
审核人员
已回答 1 个月前