[Ubuntu] 顯示使用中的 DNS Server 列表

顯示使用中的 DNS Server 列表

個人覺得最快也最簡單的方式就是直接 cat /etc/resolv.conf

執行後畫面輸出如下:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1

 

如果有設定多個 DNS Server

則會出現多行 nameserver x.x.x.x

 

雖然網路上有不少人給的答案是利用 nmcli 去取得

但筆者測試固定 IP 或 DHCP Client 都沒有顯示 IP4.DNS

手邊的系統版本為 16.04.3 LTS (Xenial)


References:
Command-line to list DNS servers used by my system – Ask Ubuntu
networking – What DNS servers am I using? – Unix & Linux Stack Exchange

Leave a comment

[Ubuntu] dpkg: warning: files list file for package * missing; assuming package has no files currently installed

某天在 Ubuntu 上使用 apt-get install 安裝套件時狂噴 warning …

dpkg: warning: files list file for package 'node-lockfile' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libhtml-tagset-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'node-normalize-package-data' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'update-inetd' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'x11proto-dri2-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'node-npmlog' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblockfile-bin' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblzma5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblzma5:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python-gnupginterface' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libhttp-date-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjs-node-uuid' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'pdksh' missing; assuming package has no files currently installed
# 族繁不及備載...

Read more “[Ubuntu] dpkg: warning: files list file for package * missing; assuming package has no files currently installed”

Leave a comment

[Git] Unable to find remote helper for ‘https’

當使用 git 以 HTTPS 連線 clone repository 時出現 …

Unable to find remote helper for ‘https’

可能是在安裝 git 時因為缺少 libcurl 套件所導致 但是環境沒有 libcurl 時一樣可以安裝,只是會不能走 HTTPS 通道而已 若要修復這個問題,只需安裝 libcurl 後重新編譯安裝 git 就好:

Ubuntu 或 Debian,先安裝 libcurl4-openssl-dev

sudo apt-get install -y libcurl4-openssl-dev 

CentOS/RedHat/Fedora,安裝 libcurl-devel.x86_64

sudo yum install -y libcurl-devel.x86_64

回到 git 原始碼目錄重新編譯並安裝 git

cd ~/git-2.8.16
./configure
make
make install

Reference: linux – Unable to find remote helper for ‘https’ during git clone – Stack Overflow

Leave a comment

Ubuntu 網路卡設定

Ubuntu 從 17.10 版開始使用 Netplan 作為系統預設的網路設定方式。如果您使用的 Ubuntu 為 17.10 以後的版本,建議參考這篇文章進行設定。


使用 ifconfig 指令查看網路卡狀態

eth0      Link encap:Ethernet  HWaddr 08:00:27:51:3c:5b
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe51:3c5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1460 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1406 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:127041 (127.0 KB)  TX bytes:299866 (299.8 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Read more “Ubuntu 網路卡設定”

Leave a comment