Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Mozilla The Internet

Making Browsers Honor the DNS SearchDomain? 48

Craig A. Smith asks: "I've always been able to use simply 'http://www' to get to my company's web site, presumably because my default search domain was 'mycompany.com.' Suddenly my browser started taking me to 'www.www.com' instead. This happened simultaneously in all browsers (tested Mozilla, IE, NS4.7 and NS7.0) an two platforms (RedHat7.2 and Win2k). The odd thing is the command 'nslookup www' (or dig or host) behaves as desired and still resolves to www.mycompany.com so I don't think this is a DNS issue. I've tried various /etc/resolv.conf settings with no luck ('domain mycompany.com' and 'search mycompany.com'). How do I get my browser to apply the default domain before tacking on the www prefix and .com suffix?"
This discussion has been archived. No new comments can be posted.

Making Browsers Honor the DNS SearchDomain?

Comments Filter:
  • Is http://www/ the location of your internet/intranet server? If so, the server might have changed it's ID.

    For example, I can type http://ceejayoz/ to get to this computer's Apache install, as I've got this computer identified as "ceejayoz".
    • No he's saying his company's domain is mycompany.com and since his computer is a member of mycompany.com he thinks it should check www.mycompany.com first. Well, the real solution to this is quit being so damn lazy. And if he really wants his www, he can just enter it into his hosts file. Or as you say enter the name which resolves some other way than DNS.
      • Actually entering www into the hosts file won't help either. The browser is not even attempting to resolve www, it is looking at it and assuming that the user made a mistake.

        A better example is a webserver named buffy on my network. It is just a local webserver for a small group, all in the same domain, to use. The domain is localgroup.city.state.branch.division.company.com and all of the machines have this in their dns search order. Ping buffy and it will resolve to buffy.localgroup.city.state.branch.division.compan y.com. This is because the computer name is not being messed with before resolution.

        In the case of the browser, typing buffy should do the same thing, however, the browser is assuming that the user has made a mistake and tries to help him/her out by appending the most common webserver prefix/suffix www and com.
        I don't think the solution is to stop being lazy. The solution is get the browser to not mess with my entry. It is a good server name and perfectly valid according to all DNS rules. I want my software to at least give me the benefit of the doubt. How about it's first assumption is that I know what I'm doing. Once that is proven false then try to help.

        (I can't help but be reminded of the overly helpful man who helps the old lady across the street, despite her insistence that she doesn't want to cross the street!)
        • My apologies, it was not explained above that you know what you are doing, and that is an overly long suffix. Depending on how important this is too you. You can set up a redirect script, on a machine on your intranet which has a name other than www.
  • ..try

    http://news.com.com

    o yeah..try to go to "slashdot dot org" ;)
  • Check whether or not your own hostname has changed. Perhaps an admin changed the dhcp settings on the server.
  • DNS (Score:2, Insightful)

    by itwerx ( 165526 )
    The technical answer:
    It's a lot more likely that something changed in the way your machine is resolving DNS. Go talk to your netadmin.

    The real answer:
    Nice Ask-Slashdot troll! :)
  • by Troodon ( 213660 ) on Thursday December 12, 2002 @03:30AM (#4868991) Homepage
    Sitting currently before Opera [opera.com] 6.05 on win2k:
    Preferences>Network>Server Name Completion>Uncheck 'Try name completion using'
    Problem solved, though perhaps not as elegant as getting your current browsers to behave.
  • Is that server up? (Score:3, Interesting)

    by Yuan-Lung ( 582630 ) on Thursday December 12, 2002 @03:35AM (#4869016)
    When the target server, in this case, http://www.yourcompany.com, is not up, your browser, depending on setting, may start searching for an alternate location.

  • quick fix... (Score:2, Informative)

    by OneFix ( 18661 )
    Add it to your hosts file.../etc/hosts for Linux and your default Windoze directory for that other OS...

    Another advantage of using this method is being able to use other abreviations for frequently visited sites...

    • Um, I thought the whole point of DNS was so you didn't have to populate/maintain the hosts file in every computer.

      • I was simply making the assumption that the author could not make the requested change at the DNS end...and while that is true, it doesn't mean that you shouldn't add aliases where you need/want them.

        For instance, the company I used to work for would have addresses for servers like d12stg034.atlanta.xxx.com ... now, if I knew this was the staging server for North America, it was much easier to make an alias...say "nastag"...and depending on the team you were on, "nastag" might have a different meaning...

        A DNS is not an excuse for not maintaining a hosts file...
        • Granted, but I see the hosts file as something the user maintains as they see fit, and as you describe in the case of your "nastag" example ("depending on the team you were on, 'nastag' might have a different meaning"), not as something the Admin must maintain on all machines (so, for example, everyone can type "www" and reach the internal web server). Indeed, if you allow users to modify hosts you've pretty much gotta give up on central control -- that central control is what DNS is for.
  • by charstar ( 64963 ) on Thursday December 12, 2002 @03:42AM (#4869057)
    it works on my machine
  • Proxy? (Score:5, Insightful)

    by skinfitz ( 564041 ) on Thursday December 12, 2002 @03:54AM (#4869090) Journal
    You've just got a new web proxy haven't you?
    • My thought too (Score:3, Informative)

      by 0x0d0a ( 568518 )
      Be an *exact* explanation of the problem.

      If they're using squid, they can recompile and tell it to not use the internal resolver...otherwise, it'll ignore searchdomains.
    • This is the best answer yet. The real question for you to ask is: "What changed?" All the folks spouting off about how it's the browser, or it's the resolver -- folks, he used to type "http://www" and get the local box he wanted. Now that no longer works. So, what changed? I'm thinking the proxy is as good a bet as anything -- I doubt your browser changed, or you would know, right?

      Here, I can just type "www" and get the local server. Mozilla seems to change that to "http://www/". If I "ping www" I get "Pinging www.companyname.com [blah blah]" but the browser doesn't show "http:/www.companyname.com/". So I don't know how Mozilla or DNS or the resolver or anything is doing this, it just works; if it stopped working, I'd ask what changed.

  • People keep refering to the technical details of resolving the addresse. I was under the impression that no matter what your setup is, if you don't add on a TLD to your address that the browser will just add it for you out of convenience. This is just one of those IE-isms that Mozilla just copied. I think what your asking is how to disable it, not how to manually add things to your /etc/hosts... I know that I used to use http://www to get to @home's homepage for a while.

    Not that I can tell you how to disable this feature... all I can say is that server-side approaches seem silly... it's smart-browsings fault, and Mozilla should have an option somewhere.
    • "This is just one of those IE-isms that Mozilla just copied."

      Uh, it has absolutely nothing to do with the browser. This is a feature of the resolver.

      E.g. in /etc/resolv.conf, I have:
      search private.domain.com


      And I have an A record for box.private.domain.com on my local DNS server.

      $ host box.private.domain.com

      box.private.domain.com A 192.168.0.1
      $ host box
      box.private.domain.com A 192.168.0.1
    • This is just one of those IE-isms that Mozilla just copied.

      Not exactly. Netscape has had this sort of feature (type in a single-segment name and it'll automatically put 'www' before it and '.com' after it, for example) since I first used Netscape Communicator 2.0 in 1996.

  • by PurpleFloyd ( 149812 ) <`zeno20' `at' `attbi.com'> on Thursday December 12, 2002 @03:56AM (#4869095) Homepage
    If dig will give you the address/full DNS name you want, it's probably a "user-friendly" addition to your browser.

    I've noticed that browsers haven't required a http:// preceding the address for a long time, nor a slash on the end. While I do this out of habit, it seems most users aren't even accustomed to putting the protocol name in front of a name or address.

    I would suggest looking through your browser's documentation and configuration, as there's probably an option to turn off the offending problem.

    Note that one way to be sure, however, is to try and ping the server in question. Even if the server doesn't reply to ping requests, ping should give you some sort of address which you can compare to the one you want, without any user-hostility getting in your way.

  • DCHP & Other Things (Score:5, Informative)

    by wdr1 ( 31310 ) <wdr1@p[ ]x.com ['obo' in gap]> on Thursday December 12, 2002 @04:17AM (#4869170) Homepage Journal
    Are you using DHCP in Windows? That's the only thing I can think of that would cause all the applications to change at once.

    Linux side, I believe if you have 'domain' configured properly in /etc/resolve.conf you should be good to go. You mentioned nslookup works correctly, but does 'telnet www 80' take you to your originial site as well?

    A few other things:

    - Consider using keywords instead of relying upon DNS to do magic for you. Create a bookmark w/ your company's website & give it the keyword 'www'. That should fix you up. (Keywords are the most currently underrated feature in the browser. Especially in regards to their ability to do searches.)

    - You want to consider the above not only for convience, but also so your companies tracking doesn't get screwed up a little. When you hit the site with just 'www' (instead of 'www.foo.com') you drop your cookies. Most sites use cookies at least to track unique visitors if nothing else, and you're probably causing a minor bit of unintended cookie churn.

    - Another poster mentioned how browsers require neither 'http://', nor the trailing slash (e.g. on http://www.slashdot.org/). Defaulting to http probably isn't that bad. Especially inside a web browser. After all, it's highly unlikely the user intended gopher://. There is a difference on the trailing slash & it's better to include. If you try to hit a server w/o the trailing slash, you'll simply get a redirect from the server to the version *with* a slash. On broadband, it's totally trival, but for narrowband users, it is noticable. Something to worth keeping in mind for the URLs your link to.

    -Bill
    • by pne ( 93383 )

      There is a difference on the trailing slash & it's better to include. If you try to hit a server w/o the trailing slash, you'll simply get a redirect from the server to the version *with* a slash. On broadband, it's totally trival, but for narrowband users, it is noticable. Something to worth keeping in mind for the URLs your link to.

      That's not how I understand it -- after all, there isn't any possible path to request for an URL such as http://www.example.com other than "/". *fx: looks up RFC* Ah, there it is, from RFC 2616 "HTTP/1.1":

      3.2.2 http URL

      The "http" scheme is used to locate network resources via the HTTP protocol. This section defines the scheme-specific syntax and semantics for http URLs.

      http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

      If the port is empty or not given, port 80 is assumed. The semantics are that the identified resource is located at the server listening for TCP connections on that port of that host, and the Request-URI for the resource is abs_path (section 5.1.2). The use of IP addresses in URLs SHOULD be avoided whenever possible (see RFC 1900 [24]). If the abs_path is not present in the URL, it MUST be given as "/" when used as a Request-URI for a resource (section 5.1.2). If a proxy receives a host name which is not a fully qualified domain name, it MAY add its domain to the host name it received. If a proxy receives a fully qualified domain name, the proxy MUST NOT change the host name.

      (Emphasis added)

      You were probably thinking of paths such as http://www.example.com/some/path , which (if they are directories) typically get turned into redirects to http://www.example.com/some/path/ . But a bare http://www.example.com is legal and equivalent to http://www.example.com/ ; the HTTP request in either case should be "GET / HTTP/1.1" by my reading of the spec.

  • by Damien Neil ( 11403 ) on Thursday December 12, 2002 @04:20AM (#4869181)
    nslookup does not use the system resolver library (gethostbyname and friends). As such, nslookup results won't tell you anything about how the system resolver is behaving.

    Check what host "ping www" resolves for a better idea of what the system resolver is up to.

    - Damien
  • How to do it: (Score:5, Informative)

    by GoRK ( 10018 ) on Thursday December 12, 2002 @09:53AM (#4870204) Homepage Journal
    Here's the way to make pretty much any browser honor your search domain. This works in IE, Moz(win/linux), Opera (win/linux), Netscape:

    Type as: http://www/

    You can also try just typing www/ .. I seem to remember that that works in some of them.

    Also if you disable name completion which I know you can do in Opera (not sure about the others) then just plain www will work.

    Enjoy,

    ~GoRK
  • by Trelane ( 16124 )
    Works for me, Mozilla 1.3a (build 2002120618), sid Debian. I use "www" in the address bar and get the departmental web server. I also use DHCP, so my resolver is configured by what the server tells pump.

    My guess is that either:
    a) Your DHCP server isn't giving you a good set of search domains, or
    b) It's a funky Windows-ism, or
    c) It's a bug in Moz that got fixed before my version.

    I don't have windows on this machine, I tested it on a nearby windows (95 or 98) machine, and got the same problem you did. Thus, I'd conclude offhand (since we share the same dhcp server) that it's b) It's a funky Windows-ism or c) It's a bug in Moz that got fixed before my version.. Maybe shelling out money for a new version of Windows would fix it, or perhaps downloading a recent nightly build?

    Wait. Analyzing further, it might well be
    d) pump is integrating the search path from the existing resolv.conf when it gets data, I'm assuming from a dhcp server that doesn't give data on the search domains.

    Thus, the answer might well be that you just need to tap your admin on the shoulder and tell them that they need to add info to DHCP server's response so that you get good search info. This should fix it for Moz, since it is known to work fine with a good search path in the version I'm using. Don't know about IE or other browsers, though.
    • Its not a windowism (could be a last century windowism (95/98, etc), as it works for me as well and I'm using win2k. I'm using mozilla 1.2.1.

      We don't use dhcp (small company). I'd think it may have to do with 'internet keywords' in smart browsing.

      Internet Keywords are a method of trying to work out what you meant when you type something that is not a URL into the URL bar. One option would be do perform a search on the words; the Internet Keywords system does this if your query doesn't match any of the things it knows about. However, before that, it knows a number of other things to try. There are certain prefixes, such as "shop" or "quote", which perform specialised searches, and you can also get information relating to a set of American cities by placing them first, e.g. "San Francisco restaurants".
      • I'm pretty sure it's that either hiesr (his+her, pronounced hee-zer) DHCP server not providing search, or not having the appropriate fields set. Or it might be a generational windowsism. I'm thinking it's probably the former or fotter (former + latter, pronounced fah-ter).

        Niftyfun word confections. ;)

        The Internet keywords is another thing entirely from what's discussed in the article. I'm not quite certain how exactly it functions; it seems to fetch urls based on what an external entity (or maybe a config file) assigns to the keywords. http://www.mozilla.org/docs/end-user/internet-keyw ords.html [mozilla.org] seems to be the page for info on it, as I see you've found. It's nice that you can customize it. :)
  • by photon317 ( 208409 ) on Thursday December 12, 2002 @10:11AM (#4870359)

    Your browser will probably go back to normal if look for and disable any features called "auto search", or "smart [browsing/urls/etc]". As a side note, one of the really annoying things about Netscape on Unix (at least the old 4.x versions), is that they actually read /etc/resolv.conf themselves, and query DNS servers themselves, instead of using the system's resolver library. You resolver might very well be configured to use some other source first, such as NIS+, but Netscape will have none of it.
  • How can I stop having these horrible, incapacitating flashbacks?!

  • http://www.geocities.com/pratiksolanki/ [geocities.com]

    // Turn off domain guessing (which adds www. and .com) for link URLs
    // This means that if you type http://cnn/, Mozilla will not try
    // to go to http://www.cnn.com. For more details read bug 34943
    // This will also fix the nasty bug where clicking in history folder
    // results in Mozilla going to www.apps5.oingo.com
    user_pref("browser.fixup.alternate.enabled", false);

  • I found out that our NIS server was giving those exact results. We had NIS clients on all Windows machines and of course all unix/Linux machines were nis too.
  • I'm just trying to figure out how you tested that combination...
  • I dropped search hal-pc.org into my resolv.conf. http://www failed to work in mozilla. Dropping to a shell and running lynx http://www worked, I was presented with www.hal-pc.org's website instead of www.com. Im running mozilla 1.0, I have ran thru most of the settings (without diving into a text editor) and havent found a disable for the automatic .com suffix.

    ********

    search

    Search list for host-name lookup. The search list is normally determined from the local domain name; by default, it contains only the local domain name. This may be changed by listing the desired domain search path following the search keyword with spaces or tabs separating the names. Most resolver queries will be attempted using each component of the search path in turn until a match is found. Note that this process may be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and that queries will time out if no server is available for one of the domains.

    The search list is currently limited to six domains with a total of 256 characters.

    *********

    DRACO-

  • The abhorrent behaviour of Mozilla regarding this is to play to the lowest denominator (i.e. clueless name completion).

    There is quite a liveley debate in bugzilla regarding this "feature".

    In the one hand are the clueless-lets-help-the stoopid-newbies crowd that believe such a thing is desirable.

    In the other hand are the technically competent that wish Mozilla will just follow common sense and used the name resolver libraries every other single program in your computer uses. No auto-completion.

    You think this is trivial?

    Let say you type bobby in your browser, then Mozilla dutifully will try to contact who knows what machines, one them perhaps www.bobby.com.

    If admin at www.bobby.com is a malicious person he can build a pretty accurate picture of your bobby's file structure checking his logs of what you are trying to access.

    A couple of poeple in bugzilla had made that point but the lets-be-nice-to-the stoopid-newbie guys don't let this thing die the painful death it deserves.

We are each entitled to our own opinion, but no one is entitled to his own facts. -- Patrick Moynihan

Working...