2

Searched all over and tried playing with httpd.conf , nothing works. The domain name can be resolved with www.domain.com but without www its does not resolve.

Advice for A Records does not work. I have a domain from Registrar otwohosting.net there panel is like publicdomainregistry.com and have options for nameservers.

I have pointed nameservers, but with mx toolbox, only www.domain.com looks up and fails for non www

What is the probable cause ? Here is snippet from httpd.conf

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/mydomain.com/
ServerName www.mydomain.com
ServerAlias mydomain.com
RewriteEngine On
RewriteRule ^/(.*) http://mydomain.com/$1 [L,R=301]
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

Its centos dedicated server, with firewall and yes port 80 is opened for tcp and udp both.

Additionally any change in document root explictly for www.domain.com also dont work. As default doc root is /var/www/html/ but i do want it to resolve it to /var/www/html/mydomain.com/ directory . Please help thanks EDIT Here is the link for my dns report [Link Removed]

It gives strange result saying it can fetch dns records but cant resolve domain.. i am laughing and tearing down my head at same time
Edit2
Following the below answer here is the update:
1) I do have 3 Nameserver received from my web hosting company . Although i have unmanaged dedicated server, but nameservers are not ns1.mydomain .. they are like ns1.mywebhost.com,ns2.mywebhost.com and have been feeded At Registrar panel
2) created CNAME Record for Host:www , Value:mydomain.com - didnt worked
3) I do have a dedicated IP Available which i should use for creating A record - Did not worked
4) After performing these actions , domain is still not resolving. Even with www also it failed, which was working earlier.


I'm running in a big trouble

UPDATE 3: Finally the solution by closetnoc worked. I used domain Registrars' Nameservers, with an Additional A Record and CNAME record to my Dedicated IP and domain name respectively.

Although the DNS propagation is very slow with my registrar (otwowebhosting.net a reseller of PDR ) , and i will plan to switch to dedicated DNS hosting service soon.

Thanks

2
  • Thanks for updating us on as to what worked, glad it's resolved.
    – dan
    Jul 30, 2014 at 4:58
  • 1
    i m glad as well, and the detailed explanation added more value to the answer by @closetnoc
    – echoashu
    Jul 30, 2014 at 8:05

2 Answers 2

3

This may be kind of easy!

Your:

ServerName www.mydomain.com

ServerAlias mydomain.com

...is backwards, should be:

ServerName mydomain.com

ServerAlias www.mydomain.com

Also, verify your DNS settings, just in case. You should have:

  • A record for mydomain.com that is an IP address
  • Either a CNAME or A record where:
  • _The CNAME is an alias www.mydomain.com for mydomain.com
  • -or-
  • _The A record for www.mydomain.com is the same IP address as mydomain.com

[Update:]

Your SOA is: ns1.p26.dynect.net

Traditionally, there are 2 SOA DNS servers for fail-over so I am not sure why I only see one. This may not be an indication of a problem. Just a side note.

Your Name Servers are:

  • ns1.p35.dynect.net
  • ns2.p35.dynect.net
  • ns3.p35.dynect.net
  • ns4.p35.dynect.net

You have an A record for mydomain.com, but no CNAME for www.mydomain.com.

It looks like dynect.net is a DNS hosting company and not your registrar. Your registrar is reporting that your name servers for your domain name are:

  • NS1.DYNAMICNETWORKSERVICES.NET
  • NS2.DYNAMICNETWORKSERVICES.NET
  • NS3.DYNAMICNETWORKSERVICES.NET
  • NS4.DYNAMICNETWORKSERVICES.NET

If I am right, your registrar name servers need to be set to:

  • ns1.p35.dynect.net
  • ns2.p35.dynect.net
  • ns3.p35.dynect.net
  • ns4.p35.dynect.net

Not all DNS servers like CNAME(s), but most work just fine.

You will need to add a CNAME for www.mydomain.com that aliases to mydomain.com. If this does not work, then remove the CNAME and create an A record for www.mydomain.com that points to the same IP address as mydomain.com. Remember that it can take some time for a DNS entry to propagate out to the DNS servers that your client computer uses. I often avoid this by setting the network to use the name servers I have my sites hosted on. In this case, it would be 2 of the ns1.p35.dynect.net, ns2.p35.dynect.net, ns3.p35.dynect.net, ns4.p35.dynect.net.

What is odd is that you say that www.mydomain.com works but mydomain.com does not. I do not doubt you of course, but it still leaves me confused. Somehow this does not make sense to me. But let's see if this solves your problem.

[Update:] For the benefit of others.

Any domain name is registered with a registrar. Every registrar is required to have a robust DNS infrastructure and one reason why I recommend that people use the registrars DNS servers. Another reason is the generally advanced control panel and support. Often this is free or very affordable.

Most scenarios are as follows. The domain name is registered and the DNS entries are hosted with the registrar. The website is either hosted with the registrar (GoDaddy comes to mind) or with another hosting company. Most hosting companies have within their control panel DNS options. This is not to be confused with the registrars DNS. Most server installs contain Bind (a DNS server) and some server applications require domain name resolution which is supplied by elements of the Bind install.

In this case, you have a registrar, a DNS host (it appears to be a service of the registrar under a different domain name), and a web host. Most of the time it is not this complicated. But I suspect that in this case, we are still using the model above.

You will need: - NS entries that are the registrars name servers. You will need at least 2 but the more the merrier. - An A record for mydomain.com that points to the IP address provided by your web host. - An CNAME for www.mydomain.com that points to mydomain.com (optionally an A record can work too.) - Any MX records for e-mail. A MX record points to a domain name. Some like to set-up a sub-domain, but if e-mail is handled by the same system as the web server, this is not necessary.

14
  • thanks @closetnoc , i modified httpd.conf and restarted httpd, no result :-( I have an ip address alloted on VM but is it required to add A name record on domain registrar? for every other site i only used nameserevers and that worked. And without other settings domain with www loads fine ! strange !!
    – echoashu
    Jul 28, 2014 at 16:55
  • Yes. You need to host all of your DNS records on the SOA (statement of authority) DNS server which is typically your registrar though not always. Your registrar DNS can point to another DNS name servers which is fine, but this adds more work and confusion for those who do not know DNS well. I like to recommend using the registrars DNS most of the time.
    – closetnoc
    Jul 28, 2014 at 17:01
  • hmm.. it is certainly the problem at registrar end then .. i have added a dns report link, which tells the same as u told (SOA thing) Sorry for novoice question - what should be my action ?
    – echoashu
    Jul 28, 2014 at 17:06
  • Can you provide a domain name so that I can do a dig (DNS record look-up) against it? This should tell me specifically what is missing.
    – closetnoc
    Jul 28, 2014 at 17:16
  • @echoashu Sorry it took me so long. I typed an answer then my computer went wonky. I had to push the dirty rotten button and wait. Then I got to research the whole thing again and re-type the answer.
    – closetnoc
    Jul 28, 2014 at 18:41
1

After looking at your domain and doing a DNS test of my own it appears that non of your nameservers have host files to serve your domain name. All of your nameservers are visible but non of them reply back when attempting to query your domain name.

If your domain.com without the www (or with anything for that matter) is resolving for you i believe this must be because your computer or ISP is cashing old records as at the time of this reply i can not get your domain to resolve to anything.

The DNS report you have provided is telling you that your nameservers are replying and online but they do not have to records for the domain in question.

1
  • Analog true, my system was cashing the records and now nothing seems to resolve . Now should i be questioning hosting provider or domain registrar ? I also found that my domain registrar otwowebhosting.net is reseller of publicdomainregistry.com
    – echoashu
    Jul 29, 2014 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.