[TriLUG] How ssh et al resolves domain names...

Aaron Joyner aaron at joyner.ws
Tue Aug 27 10:22:09 EDT 2013


You might want to also tack this onto the end of the 'host' command in
particular, lest library search path ordering cause you a lot of
unnecessary spam:

grep -v lib

eg.
strace host mirawall -c1 2>&1 | grep open | grep -v lib
strace ping mirawall -c1 2>&1 | grep open | grep -v lib

Aaron S. Joyner



On Tue, Aug 27, 2013 at 10:18 AM, Aaron Joyner <aaron at joyner.ws> wrote:

> As an exercise, try the following commands, and see what you can glean
> about what those commands are doing:
>
> strace host mirawall -c1 2>&1 | grep open
> strace ping mirawall -c1 2>&1 | grep open
>
> Some of the things that show up in the latter, that don't show up in the
> former, will be of interest to you.
>
> Please do write back and summarize what you learn,
> Aaron S. Joyner
>
>
> On Tue, Aug 27, 2013 at 10:15 AM, Francois Dion <francois.dion at gmail.com>wrote:
>
>> nsswitch.conf?
>>
>>
>>
>>
>> On Tue, Aug 27, 2013 at 9:58 AM, Brian Henning <bhenning at pineinst.com
>> >wrote:
>>
>> > Hi Gang,
>> >
>> > I think I've brought this topic up before, but it's back to taunt me
>> again.
>> > A snippet from my command line should summarize nicely:
>> >
>> > [brian at cheetah ~]$ host mirawall
>> > mirawall has address 192.168.0.106
>> > [brian at cheetah ~]$ ssh mirawall
>> > ssh: mirawall: Name or service not known
>> > [brian at cheetah ~]$ ping mirawall
>> > ping: unknown host mirawall
>> >
>> > "mirawall" is a DHCP-assigned host on the local subnet.
>> > dnsmasq provides DHCP and DNS.
>> > "mirawall" is not in the /etc/hosts file, and I don't want it to be.
>> >
>> > Why does host(1) know who "mirawall" is, but ssh(1) and ping(8) (among
>> > others) do not?  Shouldn't they all be resolving the hostname the same
>> way?
>> >
>> > Is there some config file I need to tweak?  Here's my /etc/resolv.conf:
>> >
>> > [brian at cheetah ~]$ cat /etc/resolv.conf
>> > ; generated by /sbin/dhclient-script
>> > search nc.rr.com
>> > nameserver 127.0.0.1
>> > nameserver 8.8.8.8
>> >
>> >
>> > Thanks,
>> > ~Brian
>> >
>> > ------------------------------------------------------
>> >           Brian Henning, Software Engineer
>> >
>> >     /\    Pine Research Instrumentation
>> >    //\\   2741 Campus Walk Ave, Bldg 100
>> >   ///\\\  Durham, NC 27705
>> >  ////\\\\ USA
>> >     ||
>> >     ||    phone: 919.782.8320
>> >           fax:   919.782.8323
>> >           email: bhenning at pineinst.com
>> > ------------------------------------------------------
>> >
>> >
>> >
>> > --
>> > This message was sent to: Francois Dion <francois.dion at gmail.com>
>> > To unsubscribe, send a blank message to trilug-leave at trilug.org from
>> that
>> > address.
>> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
>> > Unsubscribe or edit options on the web  :
>> > http://www.trilug.org/mailman/options/trilug/francois.dion%40gmail.com
>> > Welcome to TriLUG: http://trilug.org/welcome
>> >
>> --
>> This message was sent to: Aaron S. Joyner <aaron at joyner.ws>
>> To unsubscribe, send a blank message to trilug-leave at trilug.org from
>> that address.
>> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
>> Unsubscribe or edit options on the web  :
>> http://www.trilug.org/mailman/options/trilug/aaron%40joyner.ws
>> Welcome to TriLUG: http://trilug.org/welcome
>>
>
>


More information about the TriLUG mailing list