Solaris 10: order of searching for host names

  • Follow


In my /etc/nsswitch.conf, I have

hosts:      files       dns

and under Solaris 7, that meant that if some host was listed in
/etc/hosts, it took what if found there and didn't try to look it up in
the DNS. Which is fine and good and, if your internet connection is down
for whatever reason, you can stil find all the hosts on your LAN (which
are presumably in /etc/hosts anyway, and which are probably not in FQDN
form anyway).

But under Solaris 10, it ain't so anymore. If you happen to have a default
route set (most likely from /etc/defaultrouter), then it *always* tries in
the DNS *first*, whether or not any internat connection is actually up at
the time.

Firstly, this is stupid, because for those non FQDN names on your LAN, it
will try to add all likely domains to the end of them and try them all,
soon discovering tha they were not there and reverting to /etc/hosts.

But worse, if the internet connection is down, then it will keep trying
until the request times out (seem to be somethng like 20 or 30 seconds),
and that happens for every attempt to access your LAN; ping for some host
hangs for that 20-30 seconds and then announces that the host is alive
(whereas pinging its IP address responds immediately). But worse than
that, for some applications there is a built in timeout which aborts the
application before that 20-30 seconds is up.

So in my case, where most of my files are NFS-mounted from another
machine, it takes forever to get those partitions mounted during boot.
But, worse than that, it *never* manages to to get dtlogin as far as
displaying the login screen, so you cannot even login to fix the problem.

Well, you can use console login, but debugging such problems when all you
can see is what can be displayed on a single screen is a pain.

So please! How can I turn off this stupid behaviour?

Yes, once I discovered (after trying everything in desperation) that
removing the default route restored a sane behaviour, I was able to get
in, and eventually I got my internet connection back up, and all is now
working again. But it was a horrid waste of time.

-- 
Charles H. Lindsey ---------At Home, doing my own thing------------------------
Tel: +44 161 436 6131 Fax: +44 161 436 6133   Web: http://www.cs.man.ac.uk/~chl
Email: chl@clerew.man.ac.uk      Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
PGP: 2C15F1A9      Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5
0
Reply chl (40) 8/1/2006 5:12:52 PM

Charles Lindsey wrote:
> In my /etc/nsswitch.conf, I have
>
> hosts:      files       dns
>
> and under Solaris 7, that meant that if some host was listed in
> /etc/hosts, it took what if found there and didn't try to look it up in
> the DNS. Which is fine and good and, if your internet connection is down
> for whatever reason, you can stil find all the hosts on your LAN (which
> are presumably in /etc/hosts anyway, and which are probably not in FQDN
> form anyway).
>
> But under Solaris 10, it ain't so anymore. If you happen to have a default
> route set (most likely from /etc/defaultrouter), then it *always* tries in
> the DNS *first*, whether or not any internat connection is actually up at
> the time.
>
> Firstly, this is stupid, because for those non FQDN names on your LAN, it
> will try to add all likely domains to the end of them and try them all,
> soon discovering tha they were not there and reverting to /etc/hosts.
>
> But worse, if the internet connection is down, then it will keep trying
> until the request times out (seem to be somethng like 20 or 30 seconds),
> and that happens for every attempt to access your LAN; ping for some host
> hangs for that 20-30 seconds and then announces that the host is alive
> (whereas pinging its IP address responds immediately). But worse than
> that, for some applications there is a built in timeout which aborts the
> application before that 20-30 seconds is up.
>
> So in my case, where most of my files are NFS-mounted from another
> machine, it takes forever to get those partitions mounted during boot.
> But, worse than that, it *never* manages to to get dtlogin as far as
> displaying the login screen, so you cannot even login to fix the problem.
>
> Well, you can use console login, but debugging such problems when all you
> can see is what can be displayed on a single screen is a pain.
>
> So please! How can I turn off this stupid behaviour?
>
> Yes, once I discovered (after trying everything in desperation) that
> removing the default route restored a sane behaviour, I was able to get
> in, and eventually I got my internet connection back up, and all is now
> working again. But it was a horrid waste of time.


It's  possible   that  you are confused  because of the  semi-new
"ipnodes"   name service lookup.
Your /etc/nsswitch.conf    file should  also  have  :

ipnodes:            files       dns

/etc/inet/ipnodes     are primarily  for IPv6   but  does affect  IPv4

 behaviour as well.

//Lars

0
Reply tunla 8/2/2006 7:40:16 AM


In <1154504416.385580.220330@s13g2000cwa.googlegroups.com> "tunla" <lars.tunkrans@bredband.net> writes:

>Charles Lindsey wrote:
>> In my /etc/nsswitch.conf, I have
>>
>> hosts:      files       dns
>>
>> and under Solaris 7, that meant that if some host was listed in
>> /etc/hosts, it took what if found there and didn't try to look it up in
>> the DNS. Which is fine and good and, if your internet connection is down
>> for whatever reason, you can stil find all the hosts on your LAN (which
>> are presumably in /etc/hosts anyway, and which are probably not in FQDN
>> form anyway).
>>
>> But under Solaris 10, it ain't so anymore. If you happen to have a default
>> route set (most likely from /etc/defaultrouter), then it *always* tries in
>> the DNS *first*, whether or not any internat connection is actually up at
>> the time.
>>
>> Firstly, this is stupid, because for those non FQDN names on your LAN, it
>> will try to add all likely domains to the end of them and try them all,
>> soon discovering tha they were not there and reverting to /etc/hosts.
>>
>> But worse, if the internet connection is down, then it will keep trying
>> until the request times out (seem to be somethng like 20 or 30 seconds),
>> and that happens for every attempt to access your LAN; ping for some host
>> hangs for that 20-30 seconds and then announces that the host is alive
>> (whereas pinging its IP address responds immediately). But worse than
>> that, for some applications there is a built in timeout which aborts the
>> application before that 20-30 seconds is up.
>>
>> So in my case, where most of my files are NFS-mounted from another
>> machine, it takes forever to get those partitions mounted during boot.
>> But, worse than that, it *never* manages to to get dtlogin as far as
>> displaying the login screen, so you cannot even login to fix the problem.
>>
>> Well, you can use console login, but debugging such problems when all you
>> can see is what can be displayed on a single screen is a pain.
>>
>> So please! How can I turn off this stupid behaviour?
>>
>> Yes, once I discovered (after trying everything in desperation) that
>> removing the default route restored a sane behaviour, I was able to get
>> in, and eventually I got my internet connection back up, and all is now
>> working again. But it was a horrid waste of time.


>It's  possible   that  you are confused  because of the  semi-new
>"ipnodes"   name service lookup.
>Your /etc/nsswitch.conf    file should  also  have  :

>ipnodes:            files       dns

Yes, I have that (the Solaris 10 install fixed it)

On further thoughts, the default route was actually to my Netgear ADSL
router, which was alive (although the WAN beyind it was not). OTOH, my
Solaris 7 system also had that router as its default, and did not exhibit
the problem. So I still do not see why it needs to consult the DNS when
the answer is already to be found in /etc/hosts.

-- 
Charles H. Lindsey ---------At Home, doing my own thing------------------------
Tel: +44 161 436 6131 Fax: +44 161 436 6133   Web: http://www.cs.man.ac.uk/~chl
Email: chl@clerew.man.ac.uk      Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
PGP: 2C15F1A9      Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5
0
Reply Charles 8/3/2006 11:46:41 AM

Hi Charles,  read this

http://groups.google.es/group/comp.unix.solaris/tree/browse_frm/thread/d4aa89611e6266b9/e21454faed35ece9?rnum=1&_done=%2Fgroup%2Fcomp.unix.solaris%2Fbrowse_frm%2Fthread%2Fd4aa89611e6266b9%2F9113054943a6173d%3Flnk%3Dst%26q%3D%26rnum%3D20%26#doc_9113054943a6173d

or

http://groups.google.es/groups/search?q=%22solaris+10+name+resolution%22&qt_s=Buscar

Mariano


Charles Lindsey ha escrito:

> In <1154504416.385580.220330@s13g2000cwa.googlegroups.com> "tunla" <lars.tunkrans@bredband.net> writes:
>
> >Charles Lindsey wrote:
> >> In my /etc/nsswitch.conf, I have
> >>
> >> hosts:      files       dns
> >>
> >> and under Solaris 7, that meant that if some host was listed in
> >> /etc/hosts, it took what if found there and didn't try to look it up in
> >> the DNS. Which is fine and good and, if your internet connection is down
> >> for whatever reason, you can stil find all the hosts on your LAN (which
> >> are presumably in /etc/hosts anyway, and which are probably not in FQDN
> >> form anyway).
> >>
> >> But under Solaris 10, it ain't so anymore. If you happen to have a default
> >> route set (most likely from /etc/defaultrouter), then it *always* tries in
> >> the DNS *first*, whether or not any internat connection is actually up at
> >> the time.
> >>
> >> Firstly, this is stupid, because for those non FQDN names on your LAN, it
> >> will try to add all likely domains to the end of them and try them all,
> >> soon discovering tha they were not there and reverting to /etc/hosts.
> >>
> >> But worse, if the internet connection is down, then it will keep trying
> >> until the request times out (seem to be somethng like 20 or 30 seconds),
> >> and that happens for every attempt to access your LAN; ping for some host
> >> hangs for that 20-30 seconds and then announces that the host is alive
> >> (whereas pinging its IP address responds immediately). But worse than
> >> that, for some applications there is a built in timeout which aborts the
> >> application before that 20-30 seconds is up.
> >>
> >> So in my case, where most of my files are NFS-mounted from another
> >> machine, it takes forever to get those partitions mounted during boot.
> >> But, worse than that, it *never* manages to to get dtlogin as far as
> >> displaying the login screen, so you cannot even login to fix the problem.
> >>
> >> Well, you can use console login, but debugging such problems when all you
> >> can see is what can be displayed on a single screen is a pain.
> >>
> >> So please! How can I turn off this stupid behaviour?
> >>
> >> Yes, once I discovered (after trying everything in desperation) that
> >> removing the default route restored a sane behaviour, I was able to get
> >> in, and eventually I got my internet connection back up, and all is now
> >> working again. But it was a horrid waste of time.
>
>
> >It's  possible   that  you are confused  because of the  semi-new
> >"ipnodes"   name service lookup.
> >Your /etc/nsswitch.conf    file should  also  have  :
>
> >ipnodes:            files       dns
>
> Yes, I have that (the Solaris 10 install fixed it)
>
> On further thoughts, the default route was actually to my Netgear ADSL
> router, which was alive (although the WAN beyind it was not). OTOH, my
> Solaris 7 system also had that router as its default, and did not exhibit
> the problem. So I still do not see why it needs to consult the DNS when
> the answer is already to be found in /etc/hosts.
>
> --
> Charles H. Lindsey ---------At Home, doing my own thing------------------------
> Tel: +44 161 436 6131 Fax: +44 161 436 6133   Web: http://www.cs.man.ac.uk/~chl
> Email: chl@clerew.man.ac.uk      Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
> PGP: 2C15F1A9      Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5

0
Reply Mariano 8/3/2006 6:00:58 PM

In <1154628058.325134.279180@m79g2000cwm.googlegroups.com> "Mariano Obarrio" <mariano.obarrio@gmail.com> writes:

>Hi Charles,  read this

>http://groups.google.es/group/comp.unix.solaris/tree/browse_frm/thread/d4aa89611e6266b9/e21454faed35ece9?rnum=1&_done=%2Fgroup%2Fcomp.unix.solaris%2Fbrowse_frm%2Fthread%2Fd4aa89611e6266b9%2F9113054943a6173d%3Flnk%3Dst%26q%3D%26rnum%3D20%26#doc_9113054943a6173d

>or

>http://groups.google.es/groups/search?q=%22solaris+10+name+resolution%22&qt_s=Buscar

Yes, that did it.

Essentially, there are two files /etc/inet/hosts and /etc/inet/ipnodes.
And they advise you to copy all changes in hosts to ipnodes - fat chance
of people actually remembering to do that.

If you don't, then it looks in ipnodes first, and if it's not there it
tries DNS. And if it's not there it tries hosts (and then DNS again). The
only difference between the two is that ipnodes is allowed to contain both
Ipv6 and Ipv4 nodes, whereas hosts is only allowed to contain Ipv4.

Since I have no IPv6 hosts that I care about, I have simply made ipnodes a
hard link to hosts, and that seems to have solved the problem.

-- 
Charles H. Lindsey ---------At Home, doing my own thing------------------------
Tel: +44 161 436 6131 Fax: +44 161 436 6133   Web: http://www.cs.man.ac.uk/~chl
Email: chl@clerew.man.ac.uk      Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
PGP: 2C15F1A9      Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5
0
Reply Charles 8/4/2006 1:45:20 PM

A hard link to hosts solved the problem, but is a supported solution by
SUN?
I will try resolved this without ipnodes file change, leave the
original ipnodes and change

/etc/nsswitch

hosts: files dns
ipnodes: files

this work for my,  and is a supported solution... if you have sun
support of course..

Mariano


Charles Lindsey ha escrito:

> In <1154628058.325134.279180@m79g2000cwm.googlegroups.com> "Mariano Obarrio" <mariano.obarrio@gmail.com> writes:
>
> >Hi Charles,  read this
>
> >http://groups.google.es/group/comp.unix.solaris/tree/browse_frm/thread/d4aa89611e6266b9/e21454faed35ece9?rnum=1&_done=%2Fgroup%2Fcomp.unix.solaris%2Fbrowse_frm%2Fthread%2Fd4aa89611e6266b9%2F9113054943a6173d%3Flnk%3Dst%26q%3D%26rnum%3D20%26#doc_9113054943a6173d
>
> >or
>
> >http://groups.google.es/groups/search?q=%22solaris+10+name+resolution%22&qt_s=Buscar
>
> Yes, that did it.
>
> Essentially, there are two files /etc/inet/hosts and /etc/inet/ipnodes.
> And they advise you to copy all changes in hosts to ipnodes - fat chance
> of people actually remembering to do that.
>
> If you don't, then it looks in ipnodes first, and if it's not there it
> tries DNS. And if it's not there it tries hosts (and then DNS again). The
> only difference between the two is that ipnodes is allowed to contain both
> Ipv6 and Ipv4 nodes, whereas hosts is only allowed to contain Ipv4.
>
> Since I have no IPv6 hosts that I care about, I have simply made ipnodes a
> hard link to hosts, and that seems to have solved the problem.
>
> --
> Charles H. Lindsey ---------At Home, doing my own thing------------------------
> Tel: +44 161 436 6131 Fax: +44 161 436 6133   Web: http://www.cs.man.ac.uk/~chl
> Email: chl@clerew.man.ac.uk      Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
> PGP: 2C15F1A9      Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5

0
Reply Mariano 8/6/2006 12:41:37 PM

In <1154868097.260705.51240@m73g2000cwd.googlegroups.com> "Mariano Obarrio" <mariano.obarrio@gmail.com> writes:

>A hard link to hosts solved the problem, but is a supported solution by
>SUN?
>I will try resolved this without ipnodes file change, leave the
>original ipnodes and change

>/etc/nsswitch

>hosts: files dns
>ipnodes: files

>this work for my,  and is a supported solution... if you have sun
>support of course..

Yes, but it not clear in that case whether a DNS lookup off a site that
turns out to have an AAAA record (and maybe no A record - i.e. an IPv6
only) will get treated correctly. Whereas I know for sure that I currenly
have no need for any IPv6 addresses in /etc/[hosts,ipnodes].

-- 
Charles H. Lindsey ---------At Home, doing my own thing------------------------
Tel: +44 161 436 6131 Fax: +44 161 436 6133   Web: http://www.cs.man.ac.uk/~chl
Email: chl@clerew.man.ac.uk      Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
PGP: 2C15F1A9      Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5
0
Reply Charles 8/7/2006 11:10:22 AM

6 Replies
56 Views

(page loaded in 0.205 seconds)

Similiar Articles:













7/15/2012 2:57:39 AM


Reply: