關於「dnsmasq」的操作使用 [論壇 - Ubuntu 與工具程式及軟體推薦]
正在瀏覽:
1 名遊客
關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
延續「關於「resolvconf」的操作使用」和「#2 回覆: 網路無法連線」這兩篇的討論。
以下是對「dnsmasq」的一些探索紀錄。 以下測試環境是「Xubuntu 16.04 amd64 英文界面」。 ================================================================================ ## 相關討論 * Debian Wiki / dnsmasq * Ubuntu Community Help Wiki / Dnsmasq * Arch Wiki / dnsmasq * subject: ubuntu 1604 /etc/resolv.conf 127.0.1.1 * #3 回覆: 關於「resolvconf」的操作使用 ================================================================================ ## 鳥哥的 Linux 私房菜 * 第十九章、主機名稱控制者: DNS 伺服器 / 19.2 Client 端的設定 / 19.2.1 相關設定檔: /etc/hosts, /etc/resolv.conf, /etc/nsswitch.conf * 第十九章、主機名稱控制者: DNS 伺服器 / 19.2 Client 端的設定 / 19.2.2 DNS 的正、反解查詢指令: host, nslookup, dig * 第四章、連上 Internet ================================================================================ ## Manpage * man NetworkManager.conf * man dnsmasq ================================================================================ ## 測試環境
顯示
註: 上面「my-host-name」會根據您的系統而定。 執行
顯示
註: 也可以執行「NetworkManager --print-config」,可以參考「#5 回覆: 關於「NetworkManager」的操作使用」。 執行
顯示
執行
顯示
================================================================================ ## 測試 執行
顯示
執行
顯示
執行
顯示
================================================================================ 待續...
2017/10/2 15:45
|
||||||||||
![]() |
回覆: 關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
先簡單探索「dnsmasq」相關的套件。
================================================================================ 執行
顯示
================================================================================ 執行
顯示
================================================================================ 執行
顯示
系統一開始只有安裝「dnsmasq-base」。 ================================================================================ 執行
顯示
================================================================================ 執行
顯示
================================================================================ 待續...
2017/10/2 15:56
|
||||||||||
![]() |
回覆: 關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
接下來紀錄跟「D-Bus」相關的操作。
================================================================================ ## package * qtchooser * qdbus * qdbus-qt5 * dnsmasq-base ## manpage * $ man qdbus * $ man dnsmasq ================================================================================ ## 文件
顯示
執行下面指令,觀看「/usr/share/doc/dnsmasq-base/DBus-interface.gz」。
註: 上面「less」,可以改成「man」,「view」,「vim」 ================================================================================ 以下是操作步驟 註: 以下以「qdbus」這個工具來當範例操作, 其他類似的指令工具有「gdbus」,「dbus-send」,或是「d-feet」這個圖形界面工具。 之前相關討論有 * #3 回覆: 請教一個弱弱的問題,為什麼有些ubuntu的C code有"C"的圖示 * #4 回覆: dconf-editor 打不開節點 * #2 回覆: fcitx chewing 在右方數字鍵無法選字 ================================================================================ 執行
沒有任何顯示,跳到下一個提示字元 執行
顯示
================================================================================ 執行
顯示
================================================================================ 執行
顯示
================================================================================ 執行
顯示
================================================================================ 執行
顯示
執行
或是執行
顯示
================================================================================ 待續...
2017/10/2 16:00
|
||||||||||
![]() |
回覆: 關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
$ man gdbus
================================================================================ 執行
顯示 node / { node /uk { node /uk/org { node /uk/org/thekelleys { node /uk/org/thekelleys/dnsmasq { }; }; }; }; }; ================================================================================ 執行
顯示 node / { node /uk { node /uk/org { node /uk/org/thekelleys { node /uk/org/thekelleys/dnsmasq { interface org.freedesktop.DBus.Introspectable { methods: Introspect(out s data); signals: properties: }; interface org.freedesktop.NetworkManager.dnsmasq { methods: ClearCache(); GetVersion(out s version); GetLoopServers(out as server); SetServers(in av servers); SetDomainServers(in as servers); SetServersEx(in aas servers); SetFilterWin2KOption(in b filterwin2k); SetBogusPrivOption(in b boguspriv); AddDhcpLease(in s ipaddr, in s hwaddr, in ay hostname, in ay clid, in u lease_duration, in u ia_id, in b is_temporary); DeleteDhcpLease(in s ipaddr, out b success); signals: DhcpLeaseAdded(s ipaddr, s hwaddr, s hostname); DhcpLeaseDeleted(s ipaddr, s hwaddr, s hostname); DhcpLeaseUpdated(s ipaddr, s hwaddr, s hostname); properties: }; }; }; }; }; }; ================================================================================
顯示
================================================================================ 待續...
2017/10/2 16:02
|
||||||||||
![]() |
回覆: 關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
$ man dbus-send
================================================================================ 執行
顯示
================================================================================ 待續...
2017/10/2 16:05
|
||||||||||
![]() |
回覆: 關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
接下來探索「dnsmasq」從「NetworkManager」啟動的部份
================================================================================ $ man NetworkManager.conf 可以在「MAIN SECTION」找到「dns」那部份的說明。 dns Set the DNS (resolv.conf) processing mode. default: The default if the key is not specified. NetworkManager will update resolv.conf to reflect the nameservers provided by currently active connections. dnsmasq: NetworkManager will run dnsmasq as a local caching nameserver, using a "split DNS" configuration if you are connected to a VPN, and then update resolv.conf to point to the local nameserver. unbound: NetworkManager will talk to unbound and dnssec-triggerd, providing a "split DNS" configuration with DNSSEC support. The /etc/resolv.conf will be managed by dnssec-trigger daemon. none: NetworkManager will not modify resolv.conf. This implies rc-manager unmanaged 執行
顯示
================================================================================ 執行
顯示
執行
顯示 NetworkManager(1039)─┬─dhclient(11868) ├─dnsmasq(1418) ├─{gdbus}(1236) └─{gmain}(1215) ================================================================================ 執行
顯示
執行
顯示
執行
會下載下面三個檔案 * network-manager_1.2.6-0ubuntu0.16.04.1.debian.tar.xz * network-manager_1.2.6.orig.tar.xz * network-manager_1.2.6-0ubuntu0.16.04.1.dsc 並且解開到「network-manager-1.2.6」這個資料夾 ================================================================================ 執行下面指令,使用「dnsmasq」當關鍵字,找尋相關的檔案
顯示很多,就不列出來了。 執行下面指令,使用「127.0.1.1」當關鍵字,找尋相關的檔案
顯示 network-manager-1.2.6/debian/changelog:2108: dnsmasq (and bind) plugins should listen on for DNS resolution to 127.0.1.1, network-manager-1.2.6/debian/patches/nm-change-dnsmasq-parameters.diff:25:+ argv[idx++] = "--listen-address=127.0.1.1"; /* Should work for both 4 and 6 */ network-manager-1.2.6/debian/patches/nm-change-dnsmasq-parameters.diff:39:+ /* If caching was successful, we only send 127.0.1.1 to /etc/resolv.conf network-manager-1.2.6/debian/patches/nm-change-dnsmasq-parameters.diff:48:+ nameservers[0] = g_strdup ("127.0.1.1"); network-manager-1.2.6/debian/patches/nm-change-dnsmasq-parameters.diff:57:+ * pointing to 127.0.1.1 if any plugins were active. Thus update network-manager-1.2.6/src/dns-manager/nm-dns-dnsmasq.c:534: argv[idx++] = "--listen-address=127.0.1.1"; /* Should work for both 4 and 6 */ network-manager-1.2.6/src/dns-manager/nm-dns-manager.c:1164: /* If caching was successful, we only send 127.0.1.1 to /etc/resolv.conf network-manager-1.2.6/src/dns-manager/nm-dns-manager.c:1172: nameservers[0] = g_strdup ("127.0.1.1"); network-manager-1.2.6/src/dns-manager/nm-dns-manager.c:1757: * pointing to 127.0.1.1 if any plugins were active. Thus update 執行
顯示
以上先簡單探索到這。 ================================================================================ 暫告一段落 報告完畢 ![]()
2017/10/2 16:22
|
||||||||||
![]() |
回覆: 關於「dnsmasq」的操作使用 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
抱歉,此回覆內容,貼錯了討論串,所以刪除
Orz...
2017/10/6 15:32
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.