Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a domain that uses my host's nameservers, however there is no specific virtual host created for it. When I go to the domain, I get page not found. If I change my hosts file to have the domain point to the IP of the first nameserver or if I set up an DNS entry for www to be the IP, it works like I want it to.

According to the access and error logs, it doesn't even look like the request makes it to Apache. Is there anything else I have to configure other than just the nameserver for the doamin to get this to work? Pinging the domain brings up host not found, but pinging a domain that has a virtual host section comes up as the IP of the nameserver. What am I missing?

share|improve this question
    
Huh? The domain should always resolve to the IP. What exactly are you getting when you do a lookup for the name? –  Shane Madden Jan 29 '12 at 1:17
    
Lookup Failed. No IP address or host name with a valid lookup in input. –  SJaguar13 Jan 29 '12 at 1:38

1 Answer 1

I'm not sure if I've correctly understood the problem, so let me start by stating what I think you're saying:

  • You have a hostname (let's say host.example.com)
  • Which is configured on your example.com DNS servers to point to an IP (let's say 1.2.3.4)
  • When you enter host.example.com into a browser, the request doesn't show in the apache access/error logs, and the content from Apache doesn't show in the browser
  • When you enter a mapping for host.example.com -> 1.2.3.4 in your /etc/hosts, the page does load correctly

I don't understand what you mean by "Pinging a domain that has a virtual host section comes up as the IP of the nameserver"

Since everything works fine when you add a hosts entry, it sounds like Apache is set up correctly. Since it doesn't work without the hosts entry, my guess is that your DNS entry is wrong. Check what happens when you "dig host.example.com" - does it return the right IP?

Update: Based on this additional information:

NewDomain.com also uses ns1.mydomain.com and ns2.mydomain.com. Pinging it comes up with nothing. If I set the IP of ns1.mydomain.com to NewDomain.com in the hosts file, it works. When I do a dig on NewDomain.com, status is SERVFAIL, there is no answer, authority, or additional sections

the problem is clear. When you registered newdomain.com, you need to tell the registrar that it's hosted on ns1.mydomain.com and ns2.mydomain.com; and they need to set up the "glue" records so that other people can discover this. Some part of this has failed - either you didn't tell the registrar; or they haven't set up the glue records yet.

share|improve this answer
    
I have 2 domains. MyDomain.com and NewDomain. MyDomain.com using ns1.mydomain.com and ns2.mydomain.com without any problems. It also has a virtual host set up for it. Pinging MyDomain.com returns the IP of my server, which is the IP of ns1.mydomain.com. NewDomain.com also uses ns1.mydomain.com and ns2.mydomain.com. Pinging it comes up with nothing. If I set the IP of ns1.mydomain.com to NewDomain.com in the hosts file, it works. When I do a dig on NewDomain.com, status is SERVFAIL, there is no answer, authority, or additional sections. At the bottom, SERVER: shows the right IP. –  SJaguar13 Jan 29 '12 at 1:53
    
"MyDomain.com returns the IP of my server, which is the IP of ns1.mydomain.com" - So ns1.mydomain.com is also your web server? –  James Polley Jan 29 '12 at 2:00
    
"NewDomain.com also uses ns1.mydomain.com and ns2.mydomain.com. Pinging it comes up with nothing. If I set the IP of ns1.mydomain.com to NewDomain.com in the hosts file, it works." This confirms that you have a DNS problem. It sounds like your registrar hasn't pointed newdomain.com at ns1.mydomain.com and ns2.mydomain.com yet. –  James Polley Jan 29 '12 at 2:01
    
Do I just need to wait this out? A WHOIS on NewDomain.com shows ns1.mydomain.com and ns2.mydomain.com as the nameservers. I did a bulk update on all my domains (about 133) in GoDaddy about 24 hours ago. –  SJaguar13 Jan 29 '12 at 2:09
    
It's normal for changes to glue records to take a while to spread, but if it takes more than 24 hours I'd contact your registrar's support to let them know –  James Polley Jan 29 '12 at 2:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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