LPIC-1 / ネットワークの基礎 ・ コマンド問題
$
- getent hosts www.example.com✓ 正解
- ip neigh show www.example.com
- ss -tuln www.example.com
- arp -a www.example.com
💡 getent hosts は nsswitch.conf の hosts 行(files→dns 等の参照順)に従って名前解決し、結果を表示します。host/dig はDNSに直接問い合わせるため /etc/hosts は考慮しません。
○ getent hosts www.example.com:正解。getent hosts は nsswitch.conf の参照順(files→dns 等)に従って名前解決します。
✕ ip neigh show www.example.com:ip neigh はARP/近傍キャッシュの表示で、名前解決の確認用ではありません。
✕ ss -tuln www.example.com:ss はソケット状態の表示で、ホスト名の名前解決は行いません。
✕ arp -a www.example.com:arp -a はARPキャッシュの表示で、nsswitch経由の名前解決確認ではありません。