Gentoo Archives: gentoo-user

From: Jeremi Piotrowski <jeremi.piotrowski@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] avahi/mdns-nss and ipv4/ipv6 while pinging
Date: Thu, 28 Jun 2018 23:50:28
Message-Id: 20180628235022.GA31363@gentoo-tp
In Reply to: Re: [gentoo-user] avahi/mdns-nss and ipv4/ipv6 while pinging by tuxic@posteo.de
1 On Fri, Jun 29, 2018 at 12:13:39AM +0200, tuxic@××××××.de wrote:
2 > On 06/28 09:04, Mick wrote:
3 > > On Thursday, 28 June 2018 17:55:12 BST tuxic@××××××.de wrote:
4 > > > Hi,
5 > > >
6 > > > I am "dicovering" (what a great word :) the IP address of my Raspberry
7 > > > Pi now via ahavi/nss-mdns.
8 > > >
9 > > > When pinging my PC on my Raspberry Pi I get the IPv4-address (good!) -
10 > > > when pinging my Raspberry I only get the IPv6-address(wierd-looking) . The
11 > > > commands are identical.
12 > > >
13 > > > ifconfig on my Raspberry shows me, that the interface gets a ip4 and a
14 > > > ipv6 address.
15 > > >
16 > > > What do I need where to tweak to get ipv4 address shown when pinging?
17 > > >
18 > > > Thanks a lot for any help in advance!
19 > > > Cheers
20 > > > Meino
21 > >
22 > > ping -4 -c 3 <IP address>
23 > >
24 > > --
25 > > Regards,
26 > > Mick
27 >
28 >
29 > Hi Mick,
30 >
31 > thanks for your help! :)
32 >
33 > But...sorry I asked not exactly enough (no native speaker).
34 >
35 > I dont want to change the ping options...I am searching for
36 > a global setting, which seems to different on both machines,
37 > since the output of an unaltered ping call on each of them
38 > produces different output...
39 >
40 > What config should I modify?
41 >
42
43 /etc/nsswitch.conf, the line that starts with 'host:'.
44 Mine looks like this:
45
46 hosts: files mdns_minimal [NOTFOUND=return] dns mdns
47
48 you can specify mdns4_minimal/mdns4 instead of mdns_minimal/mdns to only
49 get ipv4 results. With mdns either ipv4 or ipv6 will be returned, but
50 apparently ipv6 is preferred.