0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UbuntuのDNS名前解決エラー(Temporary failure in name resolution)解消手順

Posted at

この記事について

VM上にインストールしたUbuntuでDNS名前解決エラーが発生したので解決の記録を残します。

環境

PC: MacBook Air M2
OS: macOS Ventura Ver. 13.2.1
Virtual Box: VirtualBox-7.1.4-165100-macOSArm64
Ubuntu image: ubuntu-24.04.1-live-server-arm64

参考

Ubuntu 20.04 temporary failure in name resolution for wired

事象

Ubuntuでping www.google.comコマンドを実行すると名前解決エラーが発生します。

Ping: www.google.com: Temporary failure in name resolution

エラー原因

/etc/resolv.confで指定されているデフォルトのDNSサーバーがDNSクエリを解決できておらずエラーが発生しているため、パブリックDNSサーバーに変更します。

解消手順

  1. 既存の設定ファイルを削除します

    sudo rm /etc/resolv.conf
    
  2. 設定ファイルを作成します

    sudo touch /etc/resolv.conf
    
  3. 作成した設定ファイルを編集します

    sudo nano /etc/resolv.conf
    
  4. nameserver 1.1.1.1 を追記し、Ctrl+Sで保存しCtrl+Xでエディタを閉じます
    image.png

  5. DNSサービスを再起動します

    sudo systemctl restart systemd-resolved.service
    
  6. pingが通るようになりました
    image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?