Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to configure DNS on my domain, however, I can only get it to work with the www prefix.

Right now I have the following DNS A records:

@             A   123.456.789
www           A   123.456.789

http://www.mydomain.com works perfectly. But http://mydomain.com fails.

I've tried all of the following:

mydomain.com  A   123.456.789
mydomain      A   123.456.789
*             A   123.456.789

But it always goes to port :80 requires a username and password. Except now it's somehow being redirected to a spammers website.

share|improve this question
add comment

2 Answers

Be sure that you have Apache vhost properly configured. It may happen that the configured vhost is www.mydomain.com only, so mydomain.com would go to some sort of default page (which may be designed as a parked domain page or 'spammers site'). If you run any sort of proxy (like Nginx) - be sure that is also properly configured for mydomain.com

share|improve this answer
add comment

This sounds more serious than it may look. If it's redirecting you to a spammer's website, your site may be infected with malware. You should first browse through the configuration on the server and see what listens for mydomain.com and if it's different than www.mydomain.com. Your DNS seems okay, but the server itself may be actually redirecting your traffic elsewhere.

Things to try to fix the issue:

  1. change your DNS records for both www and non-www to a different server, see if problem persists. If so, skip to step 3.
  2. if you don't have any problems after using a different (and presumably clean) server, then you should proceed to step 4.
  3. this would be a time to worry: your DNS servers are perhaps poisoned which can be fixed by clearing the cache and finding out how they were poisoned in the first place. Google around and ask here for help. I doubt this is the issue so I won't elaborate.
  4. your server configuration has been tampered with: you should look at ALL server configuration (Apache or Plesk or Nginx or whatever) and look for anything malicious. Try sorting by date, and look for things modified around the time you started seeing these issues. Migrate your site/files over cautiously, noting if things go sour and what you did so you can revert that.
  5. if you STILL have problems, comment below and someone or I will try to help you personally.

What really concerns me: You said that something is protected with a username/password. This could be a massive breach of security on your server, and perhaps a control panel for the attacker(s) to gain access and (maybe) do all sorts of illegal things like steal your database information if you have one, use it as a proxy server to hide themselves and put you at risk of getting the blame, using your server to attack other websites, hosting scripts and so forth.

share|improve this answer
    
Well seeing as I freshly installed the OS on the server just a few minutes before doing all this, I have doubts that it's malware. I believe it is possible to get DNS to route to your website if the www record is not set, so I think that is what happened, and actually, now that I reset it, it is giving me that username/password requirement again. –  brentonstrine Aug 25 '12 at 1:15
1  
@brentonstrine - By "spammer's site" do you mean a "parked domain"? That's a TOTALLY different story. –  ionFish Aug 25 '12 at 1:17
    
I mean http:// natedsanders (dotcom) –  brentonstrine Aug 25 '12 at 1:20
1  
@brentonstrine - What's your domain? I can't check it myself to troubleshoot without it. –  ionFish Aug 25 '12 at 1:23
add comment

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.