Après la migration vers un nouveau MacBook Pro, je ne peux plus utiliser de ping localhost
.
J'ai déjà essayé de changer de /etc/hosts
déposer alors que c’était déjà juste avant.
$ host localhost
localhost has address 127.0.0.1
localhost has IPv6 address ::1
$ ping localhost.
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.098 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.081 ms
Ping localhost.
fonctionne en quelque sorte, je ne comprends pas pourquoi.
Si je redémarre le système, il ne sera pas résolu localhost
encore une fois, mais si je ping localhost.
puis ping localhost
commence à travailler. Ne sais pas si cela peut aider quelqu'un avec le même problème
Quel pourrait être le problème?
$ ping localhost
ping: cannot resolve localhost: Unknown host
$ ping localhost.
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.072 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.084 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.077 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.073 ms
^C
--- localhost ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.072/0.076/0.084/0.005 ms
$ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.070 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.072 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.088 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.082 ms
^C
--- localhost ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
Plus de résultats
MBPdeFrancisco:~ francisco$ dscacheutil -q host -a name localhost
name: localhost
ipv6_address: fe80:1::1
MBPdeFrancisco:~ francisco$ LC_ALL=C cat -vet /etc/hosts
##$
##$
# Host Database$
#$
# localhost is used to configure the loopback interface$
# when the system is booting. Do not change this entry.$
##$
127.0.0.1 localhostM-bM-^@M-($
255.255.255.255 broadcasthostM-bM-^@M-($
::1 localhostM-bM-^@M-($
fe80::1%lo0 localhost
MBPdeFrancisco:~ francisco$ cat /etc/resolv.conf
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
# scutil --dns
#
# SEE ALSO
# dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
domain lan
nameserver 2001:8a0:ddce:7401:9e97:26ff:fedb:6214
nameserver 192.168.1.254
ping localhost.
puis ping localhost
commence à travailler
localhost
est mappé à la lo0
interface (127.0.0.1) qui est un interface de bouclage . Ça ne peut pas ne pas travail.
dscacheutil -q host -a name localhost
puis ajoutez le résultat (au format de code) à la question. Aussi, quelle est la sortie de LC_ALL=C cat -vet /etc/hosts
?