Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to reach api.example.com, but when I do Firefox says:

Couldn't resolve server www.api.example.com

What is going on? Why is Firefox adding the www by itself?

It works fine in Chrome, Safari and even on Firefox on another computer, so there must be something wrong with my local copy.

share|improve this question

migrated from stackoverflow.com Aug 31 '11 at 8:05

This question came from our site for professional and enthusiast programmers.

    
yes, im developing the api. It works in the code but i want to test it in my webbrowser aswell. –  Martin Ericson Aug 30 '11 at 8:50

2 Answers 2

This feature is controlled by the three preferences browser.fixup.alternate.enabled, browser.fixup.alternate.prefix and browser.fixup.alternate.suffix that you can see if you type about:config into the location bar. By default, if Firefox cannot resolve the server name that has been typed into the location bar it will try to "fix" it. In order to do it it will try to prepend the name with the prefix "www." and/or append the suffix ".com". Chrome has a different strategy towards "fixing" incomplete names - it will simply start a Google search.

share|improve this answer
2  
Thanks! This was one part of the solution. This alone did not work, i had to clear my complete browser history in order to make it not add the "www.". Stupid feature –  Martin Ericson Aug 30 '11 at 9:23
    
@Martin: Feel free to upvote and accept the answer if it helped you: stackoverflow.com/faq#howtoask –  Wladimir Palant Aug 30 '11 at 9:37

What I believe Firefox will do is, if you type in api.example.com, look for that first. If it can't resolve it, it will then try adding the www. on the front, as so many websites (although a decreasing number) have hostnames where the www subdomain is needed to resolve their IP address.

share|improve this answer
    
It works in Google Chrome and firefox on another computer. I can also ping api.example.com and get a response so firefox should be able to resolve it –  Martin Ericson Aug 30 '11 at 8:51
    
Have you tried downloading Live HTTP Headers and seeing whether Firefox is actually requesting and getting a response from api.example.com? –  Jez Aug 30 '11 at 8:54
    
not requesting a thing. Firebug shows a GET to www.api.example.com which is aborted instantly since it cant resolve www.api.example.com cause it doesnt exist. –  Martin Ericson Aug 30 '11 at 9:01
    
Then it looks like Firefox can't resolve api.example.com, if that's what's being entered in the location bar. –  Jez Aug 30 '11 at 9:02
    
i enter api.example.com but its trying to resolve www.api.example.com –  Martin Ericson Aug 30 '11 at 9:06

Your Answer

 
discard

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