아치 리눅스 문제 해결

아치 리눅스 문제 해결

Arch를 실행하는 Rasberry Pi가 있는데 이상한 해결 동작이 발생했습니다. 간단히 말해서 dig호스트 nslookup이름을 확인할 수 있지만 , curl, wgetpacman확인할 수 없습니다. 호스트를 추가하면 /etc/hosts해당 호스트에 대해 모든 것이 잘 작동합니다.

일부 문제 해결의 결과는 다음과 같습니다.

  1. resolv.conf존재하며 읽을 수 있습니다:

    $ ls -l /etc/resolv.conf
    -rw-r--r-- 1 root root 19 Apr 28 10:45 /etc/resolv.conf
    
  2. 네임서버가 있습니다:

    $ cat /etc/resolv.conf
    nameserver 8.8.8.8
    
  3. nslookup공장:

    $ nslookup google.com
    Server:         8.8.8.8
    Address:        8.8.8.8#53
    
    Non-authoritative answer:
    Name:   google.com
    Address: 92.87.11.30
    Name:   google.com
    Address: 92.87.11.54
    Name:   google.com
    Address: 92.87.11.49
    Name:   google.com
    Address: 92.87.11.45
    ...
    
  4. dig공장:

    $ dig google.com
    
    ; <<>> DiG 9.11.0-P3 <<>> google.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20686
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ;; QUESTION SECTION:
    ;google.com.                    IN      A
    
    ;; ANSWER SECTION:
    google.com.             299     IN      A       92.87.175.49
    google.com.             299     IN      A       92.87.175.50
    google.com.             299     IN      A       92.87.175.48
    google.com.             299     IN      A       92.87.175.44
    google.com.             299     IN      A       92.87.175.42
    google.com.             299     IN      A       92.87.175.41
    google.com.             299     IN      A       92.87.175.51
    google.com.             299     IN      A       92.87.175.36
    google.com.             299     IN      A       92.87.175.39
    google.com.             299     IN      A       92.87.175.45
    google.com.             299     IN      A       92.87.175.37
    google.com.             299     IN      A       92.87.175.40
    google.com.             299     IN      A       92.87.175.38
    google.com.             299     IN      A       92.87.175.47
    google.com.             299     IN      A       92.87.175.43
    google.com.             299     IN      A       92.87.175.46
    
    ;; Query time: 40 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Fri Apr 28 11:37:32 EEST 2017
    ;; MSG SIZE  rcvd: 295
    
  5. pingIP 중 하나를 사용할 수 있습니다 .

    $ ping 92.87.175.49
    PING 92.87.175.49 (92.87.175.49) 56(84) bytes of data.
    64 bytes from 92.87.175.49: icmp_seq=1 ttl=54 time=3.75 ms
    64 bytes from 92.87.175.49: icmp_seq=2 ttl=54 time=3.71 ms
    
    --- 92.87.175.49 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1001ms
    rtt min/avg/max/mdev = 3.711/3.734/3.758/0.065 ms
    
  6. wget실패:

    $ wget https://google.com
    --2017-04-28 11:39:31--  https://google.com/
    Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
    Resolving google.com... failed: Name or service not known.
    wget: unable to resolve host address 'google.com'
    
  7. curl실패:

    $ curl https://google.com
    curl: (6) Could not resolve host: google.com
    

내가 무엇을 놓치고 있는 걸까?!...

편집하다:

$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost

# End of file

$ cat /etc/nsswitch.conf
# Begin /etc/nsswitch.conf

passwd: compat mymachines systemd
group: compat mymachines systemd
shadow: compat

publickey: files

hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files

# End /etc/nsswitch.conf

와 관련이 있는 것 같습니다 systemd-resolvd. 중지하거나 resolve [!UNAVAIL=return]에서 제거하면 /etc/nsswitch.conf모든 앱에서 해결이 잘 작동하고, 다시 시작하거나 그대로 두면 & /etc/nsswitch.conf에 대해서만 해결이 작동합니다 .nslookupdig

답변1

Archlinuxarm 업데이트 후에도 비슷한 문제가 발생했습니다. 일부 사이트는 작동하지만 대부분을 사용할 수 없으며 pacman을 업데이트할 수 없습니다. 내 경우 문제는 시스템 확인자의 dnssec입니다. 콘솔에서 실행하여 감지할 수 있습니다.

resolvctl query archlinuxarm.org(또는 기타 사용할 수 없는 사이트)

대답은 다음과 같습니다. ... DNSSEC 검증 실패: 유효하지 않음

내 경우에는 /etc/systemd/resolved.conf에 DNSSEC=false를 추가하고 재부팅하는 데 도움이 되었습니다.

관련 정보