Contents of /etc/resolv.conf - Slackware

This is a discussion on Contents of /etc/resolv.conf - Slackware ; Hi, nothing really important, just curious. This is the contents of my /etc/resolv.conf search localhost.com nameserver 194.109.6.66 nameserver 194.109.9.99 nameserver 194.109.104.104 I just wonder if this means that if something needs to be resolved, that /etc/hosts gets searched first, and ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: Contents of /etc/resolv.conf

  1. Contents of /etc/resolv.conf

    Hi,

    nothing really important, just curious.

    This is the contents of my /etc/resolv.conf

    search localhost.com
    nameserver 194.109.6.66
    nameserver 194.109.9.99
    nameserver 194.109.104.104

    I just wonder if this means that if something needs to be resolved,
    that /etc/hosts gets searched first, and if nothing is found then the
    nameservers are searched (I suspect it goes in that order).

    The only thing I do locally is to start ftp server to serve other
    local machine, and only when needed. When done, I stop the ftp server.

    For that I don't use names, just ip adresses. So nothing needs to be
    resolved locally.

    Does this slow down resolving while web surfing? Or are it just
    microseconds?

    TIA,
    Manuel

  2. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 17:37:51 +0200, Manuel Otto wrote:
    > nothing really important, just curious.
    >
    > This is the contents of my /etc/resolv.conf
    >
    > search localhost.com
    > nameserver 194.109.6.66
    > nameserver 194.109.9.99
    > nameserver 194.109.104.104
    >
    > I just wonder if this means that if something needs to be resolved, that
    > /etc/hosts gets searched first, and if nothing is found then the
    > nameservers are searched (I suspect it goes in that order).


    This is a typical case of

    man host.conf
    man resolv.conf

    (Short answer, the order is determined in host.conf, normally it is /etc/
    hosts first, then normal resolving.)

    > The only thing I do locally is to start ftp server to serve other local
    > machine, and only when needed. When done, I stop the ftp server.
    >
    > For that I don't use names, just ip adresses. So nothing needs to be
    > resolved locally.


    Actually, you do need local names. Some programs make use of the host
    name or localhost. That's why, at the bare minimum your /etc/hosts should
    contain entries for your hostname and localhost. (Theoretically, this
    could be resolved through a DNS server, but that would be slow compared
    to reading /etc/hosts.)

    ~ Zeno

  3. Re: Contents of /etc/resolv.conf

    Manuel Otto wrote:
    >Hi,
    >
    >nothing really important, just curious.
    >
    >This is the contents of my /etc/resolv.conf


    man resolv.conf

    >search localhost.com
    >nameserver 194.109.6.66
    >nameserver 194.109.9.99
    >nameserver 194.109.104.104
    >
    >I just wonder if this means that if something needs to be resolved,
    >that /etc/hosts gets searched first, and if nothing is found then the
    >nameservers are searched (I suspect it goes in that order).


    man host.conf

    >The only thing I do locally is to start ftp server to serve other
    >local machine, and only when needed. When done, I stop the ftp server.
    >
    >For that I don't use names, just ip adresses. So nothing needs to be
    >resolved locally.
    >
    >Does this slow down resolving while web surfing? Or are it just
    >microseconds?


    Microseconds.

    --
    Floyd L. Davidson
    Ukpeagvik (Barrow, Alaska) floyd@apaflo.com

  4. Re: Contents of /etc/resolv.conf

    On 10/01/07 17:37, Manuel Otto wrote:

    > search localhost.com
    > nameserver 194.109.6.66
    > nameserver 194.109.9.99
    > nameserver 194.109.104.104
    > ------------------
    > Does this slow down resolving while web surfing? Or are it just
    > microseconds?


    IMO you should remove the directive 'search localhost.com' since you
    do not have local names to resolve.

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  5. Re: Contents of /etc/resolv.conf

    Manuel Otto wrote:
    > I just wonder if this means that if something needs to be resolved,
    > that /etc/hosts gets searched first, and if nothing is found then the
    > nameservers are searched (I suspect it goes in that order).


    a) this file is ONLY for DNS resolving, /etc/hosts doesn't have anything
    to do with it.
    b) as far as I know, only the first THREE "nameserver" lines are
    actually ever used, the rest is just for "when you comment out
    currently down nameservers" IN that file.

    PS: you can search "multiple domains" and it is custumary to put
    your own domain in a domain line first (then you do not have to put
    the domain in the /etc/HOSTNAME file anymore).

    The file "host.conf" decides IF and in what order searching for
    hostnames is done:
    order hosts, bind
    means: search the "/etc/hosts" file FIRST, and use bind (DNS resolver)
    only when THAT file doesn't contain the searched for name.
    --
    ************************************************** ******************
    ** Eef Hartman, Delft University of Technology, dept. EWI/TW **
    ** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
    ** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
    ************************************************** ******************

  6. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 18:12:02 +0200, Eef Hartman wrote:

    > Manuel Otto wrote:
    >> I just wonder if this means that if something needs to be resolved,
    >> that /etc/hosts gets searched first, and if nothing is found then the
    >> nameservers are searched (I suspect it goes in that order).

    >
    > a) this file is ONLY for DNS resolving, /etc/hosts doesn't have anything
    > to do with it.
    > b) as far as I know, only the first THREE "nameserver" lines are
    > actually ever used, the rest is just for "when you comment out
    > currently down nameservers" IN that file.
    >


    This is the setting these days in the /usr/inlude/resolv.h file:

    # define MAXNS 3 /* max # name servers we'll track */

    > PS: you can search "multiple domains" and it is custumary to put your
    > own domain in a domain line first (then you do not have to put the
    > domain in the /etc/HOSTNAME file anymore).
    >
    > The file "host.conf" decides IF and in what order searching for
    > hostnames is done:
    > order hosts, bind
    > means: search the "/etc/hosts" file FIRST, and use bind (DNS resolver)
    > only when THAT file doesn't contain the searched for name.


    could be sometimes a bit nuanced with the `/etc/nsswitch.conf'


  7. Re: Contents of /etc/resolv.conf

    On 01 Oct 2007 16:01:44 GMT, Zeno wrote:

    >On Mon, 01 Oct 2007 17:37:51 +0200, Manuel Otto wrote:
    >> nothing really important, just curious.
    >>
    >> This is the contents of my /etc/resolv.conf
    >>
    >> search localhost.com
    >> nameserver 194.109.6.66
    >> nameserver 194.109.9.99
    >> nameserver 194.109.104.104
    >>
    >> I just wonder if this means that if something needs to be resolved, that
    >> /etc/hosts gets searched first, and if nothing is found then the
    >> nameservers are searched (I suspect it goes in that order).

    >
    >This is a typical case of
    >
    >man host.conf
    >man resolv.conf


    I did read before posting, but only the relevant bit of man
    resolv.conf, but it was not completely clear to me.

    I didn't think of man host.conf...

    >(Short answer, the order is determined in host.conf, normally it is /etc/
    >hosts first, then normal resolving.)


    Thank you!

    >> The only thing I do locally is to start ftp server to serve other local
    >> machine, and only when needed. When done, I stop the ftp server.
    >>
    >> For that I don't use names, just ip adresses. So nothing needs to be
    >> resolved locally.

    >
    >Actually, you do need local names. Some programs make use of the host
    >name or localhost. That's why, at the bare minimum your /etc/hosts should
    >contain entries for your hostname and localhost. (Theoretically, this
    >could be resolved through a DNS server, but that would be slow compared
    >to reading /etc/hosts.)


    And therfore contra-productive, thanks :-)

    >~ Zeno


    Manuel

  8. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 08:05:36 -0800, floyd@apaflo.com (Floyd L.
    Davidson) wrote:

    >Manuel Otto wrote:
    >>Hi,
    >>
    >>nothing really important, just curious.
    >>
    >>This is the contents of my /etc/resolv.conf

    >
    >man resolv.conf


    I did, but the entry for 'search' in man resolv.conf was not
    completely clear to me.

    >>search localhost.com
    >>nameserver 194.109.6.66
    >>nameserver 194.109.9.99
    >>nameserver 194.109.104.104
    >>
    >>I just wonder if this means that if something needs to be resolved,
    >>that /etc/hosts gets searched first, and if nothing is found then the
    >>nameservers are searched (I suspect it goes in that order).

    >
    >man host.conf


    I didn't think of host.conf, didn't know that it was involved,
    overlooked it, guess. Don't know yet all files on system and their
    purpose, that's why I asked.

    >>The only thing I do locally is to start ftp server to serve other
    >>local machine, and only when needed. When done, I stop the ftp server.
    >>
    >>For that I don't use names, just ip adresses. So nothing needs to be
    >>resolved locally.
    >>
    >>Does this slow down resolving while web surfing? Or are it just
    >>microseconds?

    >
    >Microseconds.


    Thanks :-) It looks though, now that I've commented out 'search
    localhost.com' in resolv.conf, and have only 'order bind' and 'multi
    off' in host.conf, that resolving is very immidiate, and if a server
    does not exist, error message is extremely immidiate.

    But it also could that my isp's dns servers are just very the moment I
    tried...

    Don't know.

    Strange is that in host.conf 'multi on' is the default (I never
    changed that untill now), while in man host.conf it says:

    "multi
    This is off by default"

  9. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 16:11:03 GMT, Giovanni
    wrote:

    >On 10/01/07 17:37, Manuel Otto wrote:
    >
    >> search localhost.com
    >> nameserver 194.109.6.66
    >> nameserver 194.109.9.99
    >> nameserver 194.109.104.104
    >> ------------------
    >> Does this slow down resolving while web surfing? Or are it just
    >> microseconds?

    >
    >IMO you should remove the directive 'search localhost.com' since you
    >do not have local names to resolve.


    I did now. After reading the replies. Even if it only makes things
    microseconds faster, it's still faster.

    >Ciao
    >Giovanni


    Ciao di Manuel

  10. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 18:12:02 +0200, Eef Hartman
    wrote:

    >Manuel Otto wrote:
    >> I just wonder if this means that if something needs to be resolved,
    >> that /etc/hosts gets searched first, and if nothing is found then the
    >> nameservers are searched (I suspect it goes in that order).

    >
    >a) this file is ONLY for DNS resolving, /etc/hosts doesn't have anything
    > to do with it.


    Thanks for clearness.

    >b) as far as I know, only the first THREE "nameserver" lines are
    > actually ever used, the rest is just for "when you comment out
    > currently down nameservers" IN that file.


    Yes, that's in man resolv.conf:

    "nameserver Name server IP address
    Internet address (in dot notation) of a name server that the resolver
    should query. Up to MAXNS (currently 3, see ) name servers
    may be listed"

    >PS: you can search "multiple domains" and it is custumary to put
    >your own domain in a domain line first (then you do not have to put
    >the domain in the /etc/HOSTNAME file anymore).


    Thanks :-)

    >The file "host.conf" decides IF and in what order searching for
    >hostnames is done:
    >order hosts, bind
    >means: search the "/etc/hosts" file FIRST, and use bind (DNS resolver)
    >only when THAT file doesn't contain the searched for name.


    So I have only 'order bind' in it now, and commented out 'search
    localhost.com' in resolv.conf

    Resolving feels faster now, but it might be entirely illusion, or
    isp's dns servers are just more response at the moment.

  11. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 21:12:12 +0200, Manuel Otto wrote:

    >>IMO you should remove the directive 'search localhost.com' since you
    >>do not have local names to resolve.

    >
    > I did now. After reading the replies. Even if it only makes things
    > microseconds faster, it's still faster.


    I think you probaby have saved as much as a total of two wasted seconds
    from your life.

    Unless removing that line from resolv.conf took even longer tha two
    seconds... :-)

  12. Re: Contents of /etc/resolv.conf

    On 1 Oct 2007 21:40:36 +0200, Mark South
    wrote:

    >On Mon, 01 Oct 2007 21:12:12 +0200, Manuel Otto wrote:
    >
    >>>IMO you should remove the directive 'search localhost.com' since you
    >>>do not have local names to resolve.

    >>
    >> I did now. After reading the replies. Even if it only makes things
    >> microseconds faster, it's still faster.

    >
    >I think you probaby have saved as much as a total of two wasted seconds
    >from your life.
    >
    >Unless removing that line from resolv.conf took even longer tha two
    >seconds... :-)


    Took me longer!

    But while playing around I learn things, search and ask questions :-)

    Which cost more as just seconds...

    Computing is a waste of time anyway (are we really happier and more in
    control as we where in the stone age? Don't think so, despite all
    technologie nothing has rally changed...)

    But computer also gives me pleasure ;-) And wastes my time...

  13. Re: Contents of /etc/resolv.conf

    Manuel Otto wrote:
    >On Mon, 01 Oct 2007 08:05:36 -0800, floyd@apaflo.com (Floyd L.
    >Davidson) wrote:
    >
    >>Manuel Otto wrote:
    >>>Hi,
    >>>
    >>>nothing really important, just curious.
    >>>
    >>>This is the contents of my /etc/resolv.conf

    >>
    >>man resolv.conf

    >
    >I did, but the entry for 'search' in man resolv.conf was not
    >completely clear to me.


    Then it would have been (slightly?) better to be more
    specific about which part was not clear. It gives those
    who try to answer a better shot at hitting what you
    want. (I saw no point in trying the shotgun approach
    until I knew you had read the man pages, but now that I
    can aim at something specific... this *is* interesting!)

    >>>search localhost.com
    >>>nameserver 194.109.6.66
    >>>nameserver 194.109.9.99
    >>>nameserver 194.109.104.104
    >>>
    >>>I just wonder if this means that if something needs to be resolved,
    >>>that /etc/hosts gets searched first, and if nothing is found then the
    >>>nameservers are searched (I suspect it goes in that order).

    >>
    >>man host.conf

    >
    >I didn't think of host.conf, didn't know that it was involved,
    >overlooked it, guess. Don't know yet all files on system and their
    >purpose, that's why I asked.


    One of the things to look for in man pages is the list
    related man pages. It comes at the end of each man
    page, and can be very useful. It's also handy when you
    can't think of the *right* man page... just look at
    whatever comes to mind that *is* related, and the list
    of related pages will probably jog your memory, or
    provide one that will. (This gets more useful with age,
    I've noticed... :-)

    >>>The only thing I do locally is to start ftp server to serve other
    >>>local machine, and only when needed. When done, I stop the ftp server.
    >>>
    >>>For that I don't use names, just ip adresses. So nothing needs to be
    >>>resolved locally.
    >>>
    >>>Does this slow down resolving while web surfing? Or are it just
    >>>microseconds?

    >>
    >>Microseconds.

    >
    >Thanks :-) It looks though, now that I've commented out 'search
    >localhost.com' in resolv.conf, and have only 'order bind' and 'multi
    >off' in host.conf, that resolving is very immidiate, and if a server
    >does not exist, error message is extremely immidiate.


    Nahhh... Lets look at what actually happens!

    >But it also could that my isp's dns servers are just very the moment I
    >tried...
    >
    >Don't know.


    If a DNS query for a host named "xyzzy" is sent to a DNS
    server (as opposed to being found in /etc/hosts), what
    actually happens?

    First, /etc/resolv.conf is parsed to decide which DNS
    server... and also to see if there is a _list_ of
    potential domain names specified. (Keep in mind that it
    is not just one domain name, but a whole list that is
    available!)

    And... If there is no list specified, a default list is
    used! Hence when you remove the "search" line from your
    /etc/resolv.conf, you don't necessarily change what
    happens...

    That default list is whatever the system thinks its
    domain name is. I'm not positive how the heuristics
    work, but there are two things which apparently affect
    it. If /hostname/ returns a host that is listed in
    /etc/hosts _and_ there is also a listing with a fully
    qualified domain name, that FQDN determines the default
    search domain list. (Or, something like that.)

    Hence if your host is named "local", and you have this
    in /etc/hosts,

    192.168.0.2 local.localhost local

    You will get DNS service from /etc/hosts for either
    "local" or "local.localhosts", and queries to a DNS
    server will default to using a search list that includes
    "localhost" as the domain. (The /domainname/ command
    also seems to have an effect, but I didn't look far
    enough figure out how it all interacts.)

    I'm not sure whether it is possible to disable the list
    entirely or not, but it makes virtually no difference
    anyway! The actual query is done using the
    gethostbyaddr() function, which returns a "struct
    hostent", which looks like this (see the man page for
    gethostbyaddr(3), it is defined in netdb.h),

    struct hostent {
    char *h_name; /* official name of host */
    char **h_aliases; /* alias list */
    int h_addrtype; /* host address type */
    int h_length; /* length of address */
    char **h_addr_list; /* list of addresses */
    }

    And the man page says:

    h_name The official name of the host.

    h_aliases
    An array of alternative names for
    the host, terminated by a NULL pointer.

    Okay... what that in fact means is if a query is sent to
    the DNS server host "xyzzy" and /etc/resolv.conf has a
    list of domain name to search looks like this: "x.com
    y.com z.com", the response will be, in this order, the
    _first_ _lookup_ _that_ _succeeds_:

    xyzzy
    xyzzy.x.com
    xyzzy.y.com
    xyzzy.z.com

    And the way to know which it actually is... is to look
    at the h_name element of the returned struct. It will
    be the name that actually succeeded. (Which allows
    programs such as /dig/ to provide the option of ignoring
    the search list or not, by comparing the name sent to
    the name received, and ignoring it if they are not
    identical.)

    What's it all mean???

    1) You probably, on a correctly configured system, send
    the DNS server a list containing a single domain name,
    which will be "wrong" for every query, regardless of
    whether there is a "search" specified in file
    /etc/resolv.conf or not.

    A. Unless the DNS server actually does serve your
    domain!

    B. Or you specify a domain that the DNS server does
    serve, and actually query a host in that domain.

    2) The server will not use the search list at all if
    the exact specified name is found.

    3) The way you *can* waste a lot of time is to have a
    long list of domain names, none of which ever produce
    a match. Every query that fails would cause traffic
    on the net between the DNS server queried and the
    servers listed, as well as from all of them to the
    root DNS servers, all of which would produce failed
    search results.

    >Strange is that in host.conf 'multi on' is the default (I never
    >changed that untill now), while in man host.conf it says:
    >
    >"multi
    > This is off by default"


    What you have in your /etc/host.conf is a distribution
    default.

    That is not the same "default" as what the DNS system
    defaults to if it is not specified in /etc/host.conf.

    --
    Floyd L. Davidson
    Ukpeagvik (Barrow, Alaska) floyd@apaflo.com

  14. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 15:53:25 -0800, floyd@apaflo.com (Floyd L.
    Davidson) wrote:

    >Manuel Otto wrote:
    >>On Mon, 01 Oct 2007 08:05:36 -0800, floyd@apaflo.com (Floyd L.
    >>Davidson) wrote:
    >>
    >>>Manuel Otto wrote:
    >>>>Hi,
    >>>>
    >>>>nothing really important, just curious.
    >>>>
    >>>>This is the contents of my /etc/resolv.conf
    >>>
    >>>man resolv.conf

    >>
    >>I did, but the entry for 'search' in man resolv.conf was not
    >>completely clear to me.

    >
    >Then it would have been (slightly?) better to be more
    >specific about which part was not clear. It gives those
    >who try to answer a better shot at hitting what you
    >want. (I saw no point in trying the shotgun approach
    >until I knew you had read the man pages, but now that I
    >can aim at something specific... this *is* interesting!)


    I see... In retrospect, telling what I didn't understand from the
    entry for 'search' in man resolv.conf would have been better.

    But as to often, I was to much in a hurry, and I thought: simple
    question, simple answer, not really realizing that the matter can be
    complicated if more machines are involved...

    >>>>search localhost.com
    >>>>nameserver 194.109.6.66
    >>>>nameserver 194.109.9.99
    >>>>nameserver 194.109.104.104
    >>>>
    >>>>I just wonder if this means that if something needs to be resolved,
    >>>>that /etc/hosts gets searched first, and if nothing is found then the
    >>>>nameservers are searched (I suspect it goes in that order).
    >>>
    >>>man host.conf

    >>
    >>I didn't think of host.conf, didn't know that it was involved,
    >>overlooked it, guess. Don't know yet all files on system and their
    >>purpose, that's why I asked.

    >
    >One of the things to look for in man pages is the list
    >related man pages. It comes at the end of each man
    >page, and can be very useful. It's also handy when you
    >can't think of the *right* man page... just look at
    >whatever comes to mind that *is* related, and the list
    >of related pages will probably jog your memory, or
    >provide one that will. (This gets more useful with age,
    >I've noticed... :-)


    I've noticed those related man pages before, and then forgot about
    them again...

    Still so much to learn, and take more time, instead of hurry.

    Thanks for your tip about related man pages! I will now not forget it
    anymore.

    >>>>The only thing I do locally is to start ftp server to serve other
    >>>>local machine, and only when needed. When done, I stop the ftp server.
    >>>>
    >>>>For that I don't use names, just ip adresses. So nothing needs to be
    >>>>resolved locally.
    >>>>
    >>>>Does this slow down resolving while web surfing? Or are it just
    >>>>microseconds?
    >>>
    >>>Microseconds.

    >>
    >>Thanks :-) It looks though, now that I've commented out 'search
    >>localhost.com' in resolv.conf, and have only 'order bind' and 'multi
    >>off' in host.conf, that resolving is very immidiate, and if a server
    >>does not exist, error message is extremely immidiate.

    >
    >Nahhh... Lets look at what actually happens!
    >
    >>But it also could that my isp's dns servers are just very the moment I
    >>tried...
    >>
    >>Don't know.

    >
    >If a DNS query for a host named "xyzzy" is sent to a DNS
    >server (as opposed to being found in /etc/hosts), what
    >actually happens?
    >
    >First, /etc/resolv.conf is parsed to decide which DNS
    >server... and also to see if there is a _list_ of
    >potential domain names specified. (Keep in mind that it
    >is not just one domain name, but a whole list that is
    >available!)


    A whole list that *might* be available? Cause in my case it's only
    one: localhost.com, my local domain, and the default, because:

    "The search list is normally determined from the local domain name; by
    default, it contains only the local domain name".

    I thought 'search' in resolv.conf, was an option, rhat I could remove
    to stop searching localhost.com

    The trubble I have sometimes with understand text like:

    >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. Resolver queries having fewer than
    > ndots dots (default is 1) in them will be attempted using each component of the search path in
    > turn until a match is found. For environments with multiple subdomains please read options
    > ndots:n below to avoid man-in-the-middle attacks and unnecessary traffic for the root-dns-servers.
    > 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.


    that it really gives a whole lot of information, of which I don't
    understand (enough) some. Just never looked very deep into this
    matter, as I only have 2 machines here 006.localhost.com (Win98
    machine, which not been ON for over a month), and 007.localhost.com,
    the Linux Slackware machine.

    I don't need to do anything complicated with domains and hosts.

    When I don't understand some of the information, it makes it harder to
    undestand the rest, cause it all depends on its other.

    Entirely my problem of course, but I really thought I was asking afew
    very simple question, with very simple answers...

    >And... If there is no list specified, a default list is
    >used! Hence when you remove the "search" line from your
    >/etc/resolv.conf, you don't necessarily change what
    >happens...


    I thougt removing the line, would stop it from it from searching
    localhost.com...

    >That default list is whatever the system thinks its
    >domain name is. I'm not positive how the heuristics
    >work, but there are two things which apparently affect
    >it. If /hostname/ returns a host that is listed in
    >/etc/hosts _and_ there is also a listing with a fully
    >qualified domain name, that FQDN determines the default
    >search domain list. (Or, something like that.)
    >
    >Hence if your host is named "local", and you have this
    >in /etc/hosts,
    >
    > 192.168.0.2 local.localhost local
    >
    >You will get DNS service from /etc/hosts for either
    >"local" or "local.localhosts", and queries to a DNS
    >server will default to using a search list that includes
    >"localhost" as the domain. (The /domainname/ command
    >also seems to have an effect, but I didn't look far
    >enough figure out how it all interacts.)
    >
    >I'm not sure whether it is possible to disable the list
    >entirely or not, but it makes virtually no difference
    >anyway! The actual query is done using the
    >gethostbyaddr() function, which returns a "struct
    >hostent", which looks like this (see the man page for
    >gethostbyaddr(3), it is defined in netdb.h),
    >
    > struct hostent {
    > char *h_name; /* official name of host */
    > char **h_aliases; /* alias list */
    > int h_addrtype; /* host address type */
    > int h_length; /* length of address */
    > char **h_addr_list; /* list of addresses */
    > }
    >
    >And the man page says:
    >
    > h_name The official name of the host.
    >
    > h_aliases
    > An array of alternative names for
    > the host, terminated by a NULL pointer.
    >
    >Okay... what that in fact means is if a query is sent to
    >the DNS server host "xyzzy" and /etc/resolv.conf has a
    >list of domain name to search looks like this: "x.com
    >y.com z.com", the response will be, in this order, the
    >_first_ _lookup_ _that_ _succeeds_:
    >
    > xyzzy
    > xyzzy.x.com
    > xyzzy.y.com
    > xyzzy.z.com
    >
    >And the way to know which it actually is... is to look
    >at the h_name element of the returned struct. It will
    >be the name that actually succeeded. (Which allows
    >programs such as /dig/ to provide the option of ignoring
    >the search list or not, by comparing the name sent to
    >the name received, and ignoring it if they are not
    >identical.)


    The way you describe it gives me some very vague understanding how it
    all works and interacts. But I still find it very complicated.

    I think for me real understanding only comes when it gets a practical
    thing for, I mean that I exually have to configure a local network
    with more then 1 or 2 machines.

    For me it's quite abstract, reading it like this. Always had some
    difficulty with learning abstract things without having to use it.

    >What's it all mean???
    >
    > 1) You probably, on a correctly configured system, send
    > the DNS server a list containing a single domain name,
    > which will be "wrong" for every query, regardless of
    > whether there is a "search" specified in file
    > /etc/resolv.conf or not.


    I send to my isp's dns server the list containing single domain
    localhost.com??? While that is not needed? It should not get more
    weird...

    > A. Unless the DNS server actually does serve your
    > domain!


    Which it doesn't, of course :-) localhost.com is a valid local domain
    name, like example.net.

    > B. Or you specify a domain that the DNS server does
    > serve, and actually query a host in that domain.


    Aha, so I could use the 'search' option to let my isp's dns server
    query someone else?

    > 2) The server will not use the search list at all if
    > the exact specified name is found.
    >
    > 3) The way you *can* waste a lot of time is to have a
    > long list of domain names, none of which ever produce
    > a match. Every query that fails would cause traffic
    > on the net between the DNS server queried and the
    > servers listed, as well as from all of them to the
    > root DNS servers, all of which would produce failed
    > search results.


    I can understand that. But with 'search localhost.com', not much time
    is wasted, as my isp's dns server doesn't serve localhost.com.

    >>Strange is that in host.conf 'multi on' is the default (I never
    >>changed that untill now), while in man host.conf it says:
    >>
    >>"multi
    >> This is off by default"

    >
    >What you have in your /etc/host.conf is a distribution
    >default.


    Okee.

    >That is not the same "default" as what the DNS system
    >defaults to if it is not specified in /etc/host.conf.


    Clear.

    Thanks for helping me understand just a little bit more,
    Manuel

  15. Re: Contents of /etc/resolv.conf

    Manuel Otto wrote:

    > I send to my isp's dns server the list containing single domain
    > localhost.com??? While that is not needed? It should not get more
    > weird...


    No. You don't send the list to your isp's dns server.
    But if a lookup fails you'll repeat the query with one of the
    elements from your list appended the the host name.
    If the lookup fails again the next element will be tried, and so on.
    This way a query for "host" could result in "host.work.tld" or
    "host.localnet"; depending on your search list. You should be aware
    that a host name *can* exist on several domains. In that case the
    order of your list will determine which host will be found.
    And, unless you run your own name server, you never want to include
    your local home domain to the search list.

    >
    >> A. Unless the DNS server actually does serve your
    >> domain!

    >
    > Which it doesn't, of course :-) localhost.com is a valid local domain
    > name, like example.net.


    Don't be too sure about that!
    "localhost.com" and "example.net" are both official registered domains.
    Just run: "whois localhost.com" and "whois example.net".

    If you want to use a local network you really should use a name that
    is *only* valid at your place. Use something like ".local", ".localnet"
    or ".example". Never add valid top level domains to those names.
    Adding valid top level domains will, at best, waste bandwidth and time
    while there is always some risk that you'll hit a valid domain.

    Regards,

    Kees.

    --
    Kees Theunissen.

  16. Re: Contents of /etc/resolv.conf

    On Mon, 01 Oct 2007 17:37:51 +0200
    Manuel Otto wrote:
    > Does this slow down resolving while web surfing? Or are it just
    > microseconds?


    I don't think DNS requests go much faster than, say, traceroute's or
    ntpdate's ones. Thus, DNS requests take time of the order of N x 10^{-3} s,
    i.e., units of milliseconds, not microseconds.

    Mikhail

  17. Re: Contents of /etc/resolv.conf

    On Wed, 3 Oct 2007 08:18:12 +0400, Mikhail Zotov
    wrote:

    >On Mon, 01 Oct 2007 17:37:51 +0200
    >Manuel Otto wrote:
    >> Does this slow down resolving while web surfing? Or are it just
    >> microseconds?

    >
    >I don't think DNS requests go much faster than, say, traceroute's or
    >ntpdate's ones. Thus, DNS requests take time of the order of N x 10^{-3} s,
    >i.e., units of milliseconds, not microseconds.
    >
    >Mikhail


    Thanks! :-)

  18. Re: Contents of /etc/resolv.conf

    On Wed, 03 Oct 2007 02:46:46 +0200, Kees Theunissen
    wrote:

    >Manuel Otto wrote:
    >
    >> I send to my isp's dns server the list containing single domain
    >> localhost.com??? While that is not needed? It should not get more
    >> weird...

    >
    >No. You don't send the list to your isp's dns server.
    >But if a lookup fails you'll repeat the query with one of the
    >elements from your list appended the the host name.
    >If the lookup fails again the next element will be tried, and so on.
    >This way a query for "host" could result in "host.work.tld" or
    >"host.localnet"; depending on your search list. You should be aware
    >that a host name *can* exist on several domains. In that case the
    >order of your list will determine which host will be found.


    Some time ago, I was confused with which was a host, a host name, a
    domain, or a domain name.

    I thought I understoud after some reading that in 007.localhost.com
    007 is the host, localhost.com the domain, and 007.localhost.com the
    domain name (the confusion began when installing Slackware first time,
    and I configered network. It asks for host, and then domain).

    But now I read stome confusing things, like here:
    http://en.wikipedia.org/wiki/Host_name it says:

    "On the Internet, a hostname is a domain name assigned to the host.
    This is usually a combination of the host's local name with its parent
    domain's name. For example, "en.wikipedia.org" consists of a hostname
    ("en") and the domain name "wikipedia.org". This kind of hostname is
    translated into an IP address via the local hosts file, or the Domain
    Name System (DNS) resolver. It is possible for a single host to have
    several hostnames; but generally the operating system of the host
    prefers to have one hostname that the host uses for itself.

    Any domain name can also be hostname, as long as the restrictions
    mentioned below are followed. So, for example, both "en.wikimedia.org"
    and "wikimedia.org" are hostnames because they both have IP addresses
    assigned to them. The domain name "pmtpa.wikimedia.org" is not a
    hostname since it does not have an IP address, but
    "rr.pmtpa.wikimedia.org" is a hostname. All hostnames are domain
    names, but not all domain names are hostnames."

    While reading that information, I find it hard, blocks me. Maybe cause
    the defenitions are overlapping each other.

    >And, unless you run your own name server, you never want to include
    >your local home domain to the search list.
    >

    I never did that myself, it was there after I had configured my very
    simple network (no dhcp, 3 nameservers, 2 local machines with static
    ip, and a gateway: adsl modem router).
    >>
    >>> A. Unless the DNS server actually does serve your
    >>> domain!

    >>
    >> Which it doesn't, of course :-) localhost.com is a valid local domain
    >> name, like example.net.

    >
    >Don't be too sure about that!
    >"localhost.com" and "example.net" are both official registered domains.
    >Just run: "whois localhost.com" and "whois example.net".


    I see... I really thougt what I did have is a valid local name.
    Searched for it, and after some time arrived at a page which looked
    like having authority on the subject. It said localhost.com and
    example.net are perfectly all right to use.

    Did my best to find that that page again, but no luck.

    But might have been one of these pages: http://example.net/

    Cann't try now what localhost.com on web says, cause it points to my
    machine now, but it might have been something similair.

    Think my confusion came from that.

    >If you want to use a local network you really should use a name that
    >is *only* valid at your place. Use something like ".local", ".localnet"
    >or ".example". Never add valid top level domains to those names.
    >Adding valid top level domains will, at best, waste bandwidth and time
    >while there is always some risk that you'll hit a valid domain.


    Not very original names, I think, but after finishing the posts I have
    to reply to, my computers will be named:

    006.home.localnet
    007.home.localnet

    >Regards,
    >
    >Kees.


    Mch appreciated,
    Manuel

  19. Re: Contents of /etc/resolv.conf

    On Thu, 04 Oct 2007 23:09:45 +0200, Manuel Otto wrote:

    > Some time ago, I was confused with which was a host, a host name, a
    > domain, or a domain name.
    >
    > I thought I understoud after some reading that in 007.localhost.com
    > 007 is the host, localhost.com the domain, and 007.localhost.com the
    > domain name (the confusion began when installing Slackware first time,
    > and I configered network. It asks for host, and then domain).
    >
    > But now I read stome confusing things, like here:
    > http://en.wikipedia.org/wiki/Host_name it says: ....


    It's Wikipedia. If you find it confusing, just edit it until it aligns
    with your understanding of the subject.

  20. Re: Contents of /etc/resolv.conf

    On 5 Oct 2007 08:41:43 +0200, Mark South
    wrote:

    >On Thu, 04 Oct 2007 23:09:45 +0200, Manuel Otto wrote:
    >
    >> Some time ago, I was confused with which was a host, a host name, a
    >> domain, or a domain name.
    >>
    >> I thought I understoud after some reading that in 007.localhost.com
    >> 007 is the host, localhost.com the domain, and 007.localhost.com the
    >> domain name (the confusion began when installing Slackware first time,
    >> and I configered network. It asks for host, and then domain).
    >>
    >> But now I read stome confusing things, like here:
    >> http://en.wikipedia.org/wiki/Host_name it says: ....

    >
    >It's Wikipedia. If you find it confusing, just edit it until it aligns
    >with your understanding of the subject.


    Well yes but... I'm sure tht, even *if* there are some errors in that
    article, thatmy understanding of the subject far, far less as what I
    read in that Wikipedia article.

    So It's better I do not edit anything ;-)

+ Reply to Thread
Page 1 of 2 1 2 LastLast