Skip to content
Networking & DNSAdvanced

Domain Not Connected to Hosting: DNS Configuration and 502 Bad Gateway Troubleshooting

Quick Answer A domain may be reported as not connected to its hosting service when its DNS configuration does not correctly point to the web hosting server o...

BI
Bison Technical Team Enterprise IT specialists
Updated 11 Nov 2026 13 min read 1 total views
Structured technical guidanceSafety notes included where requiredSources listed below

Quick Answer

A domain may be reported as not connected to its hosting service when its DNS configuration does not correctly point to the web hosting server or when the hosting provider cannot verify the required DNS records.

This situation commonly occurs when:

Advertisement
  • The domain uses nameservers managed by an external DNS provider.
  • The domain's A or CNAME records point to an incorrect destination.
  • The required DNS records are missing or incorrectly configured.
  • The domain was recently connected to a new hosting service and DNS changes have not fully propagated.
  • The domain has not been added or configured correctly within the hosting account.

Incorrect DNS configuration can prevent visitors from reaching the intended website. However, a 502 Bad Gateway error has a more specific meaning: a gateway or proxy server received an invalid response from an upstream server while processing a request.

To resolve the issue, verify the domain's nameservers, check the DNS records at the provider currently managing DNS, confirm the correct hosting destination and investigate server-side problems if the 502 error continues.

Understanding Domain and Hosting Connectivity

What does it mean when a domain is not connected to hosting?

A domain name is the address visitors use to access a website, while web hosting is the service that stores and delivers the website's files, applications and content.

For a website to work correctly, its domain must resolve to the appropriate hosting destination, and the hosting server must be configured to serve that domain.

For example, a domain may be registered with one company, its DNS may be managed by another company, and its website may be hosted on a third company's server. This arrangement is completely valid as long as the DNS records and hosting configuration are correct.

A domain connection warning generally indicates that the hosting provider cannot verify the expected connection. It does not necessarily mean that the domain registration or hosting service is inactive.

What are nameservers?

Nameservers are DNS servers responsible for providing authoritative DNS information for a domain.

When a domain is registered, its nameserver settings determine which DNS provider manages its DNS zone. The DNS zone contains records that direct website traffic, email services and other domain-related services.

Common nameserver arrangements include:

  • Hosting provider nameservers: DNS management is handled by the company providing website hosting.
  • Domain registrar nameservers: DNS management is handled through the company where the domain is registered.
  • External DNS provider nameservers: DNS management is handled by a separate DNS service.

Using external nameservers does not prevent a domain from being connected to a hosting service. However, DNS changes must be made through the provider whose nameservers are authoritative for the domain.

Common Reasons a Domain Is Not Connected to Hosting

1. Incorrect nameserver configuration

If a domain's nameservers point to an unexpected DNS provider, the hosting provider may not be able to manage or verify its DNS configuration through its own DNS management interface.

This is not necessarily a problem if the external DNS provider is being used intentionally. The important requirement is that the authoritative DNS zone contains the correct records for the hosting service.

2. Incorrect A record

An A record maps a domain name to an IPv4 address.

If the root domain points to an old hosting server, an incorrect IP address or an unrelated server, visitors may reach the wrong destination.

The correct IP address should be obtained directly from the hosting provider's domain connection instructions or hosting control panel.

3. Incorrect CNAME record

A CNAME record makes one hostname an alias of another hostname.

For example, the www version of a domain may use a CNAME record pointing to a hostname specified by the hosting provider.

An incorrect or conflicting CNAME record can prevent the hostname from resolving to the intended website destination.

4. DNS propagation and caching

When DNS records or nameservers are changed, the updated information may not become visible to every DNS resolver immediately.

DNS caching and Time to Live (TTL) settings determine how long previously retrieved DNS information may be retained. As a result, different visitors may temporarily receive different DNS responses.

5. Domain not added to the hosting account

Correct DNS records alone may not be sufficient. Some hosting environments require the domain to be added to the hosting account and configured as a primary domain, addon domain, website domain or virtual host.

If the hosting server does not recognize the requested domain, it may display a default page, connection warning or another server response.

6. Hosting server or application problems

Even when DNS is configured correctly, the website may remain unavailable because of server-side problems.

Possible causes include:

  • Web server or application server failures.
  • PHP or application runtime errors.
  • Reverse proxy configuration problems.
  • Database connection failures.
  • Insufficient server resources.
  • Firewall or network connectivity restrictions.
  • Temporary hosting service outages.

How to Troubleshoot a Domain Not Connected to Hosting

Follow the steps below to identify whether the issue is related to domain registration, DNS configuration, hosting setup or server availability.

Step 1: Confirm that the domain is active

Log in to the domain registrar's account and verify that:

  • The domain registration has not expired.
  • The domain is not suspended or locked due to a registration issue.
  • The domain's nameserver settings are accessible.
  • You have permission to manage the domain's DNS configuration.

If the domain is expired or suspended, resolve the registration issue before troubleshooting the hosting connection.

Step 2: Identify the authoritative DNS provider

Check the domain's current nameserver configuration to identify where its DNS records are managed.

On a Windows computer, open Command Prompt and execute:

nslookup -type=NS example.com

Replace example.com with the actual domain name.

The command displays the nameservers returned by the DNS resolver.

Alternatively, use an online DNS lookup service such as DNSChecker to inspect nameserver information.

Once you identify the authoritative DNS provider, log in to its control panel to inspect and manage the domain's DNS records.

Step 3: Obtain the correct DNS configuration from the hosting provider

Log in to your web hosting account and locate the domain connection or custom domain configuration section.

Obtain the exact DNS information required for your hosting service. Depending on the hosting platform, this may include:

  • One or more IPv4 addresses for A records.
  • An IPv6 address for an AAAA record, if supported.
  • A destination hostname for a CNAME record.
  • Nameservers provided by the hosting company.
  • TXT records required for domain ownership verification.

Do not assume that all hosting services use the same DNS configuration. Website builders, shared hosting, cloud hosting and dedicated servers may require different records.

Step 4: Review and correct DNS records

Open the DNS management panel of the authoritative DNS provider and review the existing records.

A typical DNS configuration may include the following records:

Record Type Purpose Configuration
A Maps a hostname to an IPv4 address. Use the hosting provider's specified IPv4 address.
AAAA Maps a hostname to an IPv6 address. Use the correct IPv6 destination if supported.
CNAME Maps a hostname to another hostname. Use the destination supplied by the hosting provider.
TXT Stores text-based verification and configuration information. Use the exact value supplied by the relevant service.
MX Directs incoming email to mail servers. Preserve the records required by the email provider.

Important precautions:

  • Do not delete DNS records without understanding their purpose.
  • Check for conflicting A, AAAA and CNAME records.
  • Do not replace email-related MX and TXT records unnecessarily.
  • Do not use an IP address from an unrelated hosting account.
  • Follow the exact DNS configuration supplied by the hosting provider.

Step 5: Choose the appropriate nameserver arrangement

There are two common ways to connect a domain to a hosting service.

Option A: Use the hosting provider's nameservers

Change the domain's nameserver settings at the domain registrar to the exact nameservers supplied by the hosting company.

With this arrangement, DNS management is generally transferred to the hosting provider. Existing DNS records may need to be recreated in the new DNS zone.

Option B: Retain the existing external DNS provider

Keep the current nameservers unchanged and update the necessary DNS records through the existing DNS provider's control panel.

This approach is useful when DNS is managed independently through an external DNS service, CDN or dedicated DNS management platform.

Important: Do not change nameservers merely because they belong to an external provider. If the existing DNS configuration is correct and the hosting service supports external DNS management, changing nameservers may be unnecessary.

Step 6: Verify DNS resolution

After updating the DNS configuration, verify that the domain resolves to the intended destination.

To check the IPv4 address, execute:

nslookup -type=A example.com

To check the IPv6 address, execute:

nslookup -type=AAAA example.com

To check the www hostname, execute:

nslookup www.example.com

Compare the returned values with the configuration supplied by the hosting provider.

You can also compare DNS responses from different locations using:

Step 7: Verify the hosting account configuration

If DNS resolves correctly but the domain still does not display the website, check the hosting account.

Verify that:

  • The domain has been added to the correct hosting account.
  • The domain is associated with the intended website directory or application.
  • The website files are present in the correct document root.
  • The web server configuration recognizes the domain.
  • The website is published and accessible.
  • The hosting service is active and not suspended.

If the hosting platform requires domain verification, complete that process as instructed by the provider.

Understanding the 502 Bad Gateway Error

A 502 Bad Gateway is an HTTP server error that occurs when a server acting as a gateway or proxy receives an invalid response from an upstream server while attempting to process a request.

An upstream server is another server or application that the gateway communicates with to fulfil a website request.

For example, a website may use a reverse proxy in front of an application server. If the application server returns an invalid response, the reverse proxy may display a 502 error.

How is a 502 error related to DNS?

DNS and HTTP server communication are separate but related parts of website connectivity.

Incorrect DNS records may direct visitors or proxy services to an unintended server. That server may not be configured to handle the requested website correctly.

However, a DNS problem does not automatically generate a 502 response. Depending on the circumstances, DNS failures may instead produce a name resolution error, connection failure or another response.

A 502 error specifically identifies a failure in the communication between a gateway or proxy and an upstream server, as defined by the HTTP specification.

Common causes of 502 Bad Gateway

  • Upstream server unavailable: The application or origin server is not responding correctly.
  • Web server configuration error: The gateway is configured to communicate with an incorrect upstream address or port.
  • Application failure: The website application or runtime is returning an invalid response.
  • Resource exhaustion: CPU, memory or process limits are affecting application availability.
  • Reverse proxy problems: Communication between the proxy and backend service is failing.
  • Firewall restrictions: Network security rules are blocking communication between servers.
  • CDN or proxy configuration: The configured origin destination or connection settings are incorrect.

How to Fix a 502 Bad Gateway Error

If the domain resolves to the correct hosting destination but the website continues to display a 502 error, investigate the server and application environment.

1. Check the hosting server status

Check whether the hosting service is operational. Review service notifications, maintenance announcements and server availability information.

If the hosting provider is experiencing an outage, wait for the service to recover or contact its technical support team.

2. Inspect server and application error logs

Review the web server, application server and PHP error logs, where applicable.

Look for errors occurring around the time the 502 response appeared. Relevant entries may identify upstream connection failures, application crashes, timeout conditions or configuration problems.

3. Check application and database connectivity

Web applications may depend on databases and other backend services. Verify that these services are running and that the application can communicate with them.

Check application logs for connection failures, authentication errors and unexpected process termination.

4. Review resource usage

Check CPU, RAM, disk space, process limits and other available hosting resource metrics.

If the server is running out of resources, investigate the underlying workload rather than immediately increasing limits or restarting services without diagnosis.

5. Review reverse proxy and firewall settings

If the website uses a reverse proxy, CDN or web application firewall, verify that:

  • The configured origin address is correct.
  • The required network ports are accessible.
  • The origin server is reachable.
  • SSL/TLS settings are compatible.
  • Firewall rules permit legitimate communication between services.

6. Investigate recent configuration changes

If the error started after a website update, server migration, DNS change or configuration modification, review the changes made immediately before the problem appeared.

Where possible, test corrective changes in a staging environment and maintain a backup before modifying production configuration.

7. Contact the hosting provider

If the DNS configuration is correct but the 502 error continues, contact the hosting provider with the following information:

  • Domain name.
  • Approximate time when the error occurred.
  • Screenshot of the error.
  • DNS lookup results.
  • Relevant application or server error logs.
  • Recent changes to the hosting configuration.

This information can help the technical support team identify whether the problem originates from DNS routing, the web server, an upstream application or another infrastructure component.

Important Precautions Before Changing DNS Settings

DNS changes can affect more than website accessibility. A domain may also use DNS records for email, verification, security and third-party services.

Before making changes:

  • Record the existing DNS configuration.
  • Preserve MX records used by the email service.
  • Preserve SPF, DKIM and DMARC records.
  • Check whether subdomains depend on existing DNS records.
  • Verify whether a CDN or proxy is currently being used.
  • Confirm the exact destination values with the hosting provider.
  • Avoid unnecessary nameserver changes.

If changing nameservers, ensure that all required records are available in the new authoritative DNS zone before or during the migration.

Frequently Asked Questions

Can a domain use external nameservers and still work with any hosting provider?

Yes. A domain can use an independent DNS provider while its website is hosted elsewhere. The DNS provider must publish the correct records required to direct traffic to the hosting service.

Do domain registration and website hosting need to be with the same company?

No. Domain registration, DNS management and web hosting are separate services. They can be provided by different companies, provided the domain's DNS and hosting configuration are correctly maintained.

Does changing nameservers automatically fix a 502 error?

No. Changing nameservers may correct an incorrect DNS configuration, but it does not repair application failures, upstream server problems, reverse proxy errors or other hosting issues.

What is the difference between nameservers and DNS records?

Nameservers identify the authoritative DNS service responsible for a domain's DNS zone. DNS records contain the actual information used to direct traffic and configure domain-related services.

How long does DNS propagation take?

DNS changes may become visible within minutes, but cached records and TTL settings can cause delays. Nameserver changes can take longer to be reflected consistently across different DNS resolvers.

Why does my website work with an IP address but not with its domain name?

This may indicate a DNS resolution issue, incorrect virtual host configuration, missing domain association or SSL configuration problem. An IP address may also display a different website because hosting servers commonly use domain names to identify the requested website.

Should I delete all existing DNS records before connecting a domain to hosting?

No. Deleting all DNS records can interrupt email delivery, domain verification, subdomains and third-party services. Only modify records that conflict with the required hosting configuration.

What should I do if DNS is correct but the website still shows a 502 error?

Investigate the hosting server, upstream application, database connectivity, resource usage, reverse proxy and firewall configuration. Contact the hosting provider if the issue cannot be identified through available logs and diagnostics.

Official References

Key Takeaways

A domain connection problem can originate from incorrect nameservers, missing DNS records, incorrect hosting destinations, incomplete DNS propagation or an improperly configured hosting account.

Using an external DNS provider is perfectly valid and does not require transferring the domain or changing nameservers, provided the required DNS records are configured correctly.

A 502 Bad Gateway error should be investigated separately because it specifically indicates an invalid response from an upstream server to a gateway or proxy. Correct DNS configuration is an important part of website connectivity, but server-side diagnostics may still be necessary to restore website availability.

YOUR FEEDBACK

Was this guide useful?

Your answer helps us keep BISONKB accurate and practical.

Links are permitted only to published BISONKB articles.
THE BISON BRIEF

Practical IT knowledge, once a week.

New troubleshooting guides, scripts and infrastructure notes. No noise.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.