domain name 查詢順序問題 - Linux

Queena avatar
By Queena
at 2010-03-18T21:33

Table of Contents

請問一下 當我在我的 hosts 檔下面定義好 ip domain NAME 的對應
例如 192.168.0.5 a.b.com
但是當我用 nslookup 查詢 a.b.com 的時候,解出來的資料卻不是192.168.0.5
而是 DNS 回應給我的資料。
/etc/nsswitch.conf 中 hosts的設定是先 file 後 dns
那位什麼還是會跑去問 dns 呢

--
我真的很羞澀.............(≧<>≦)
... .. . 阮囊羞澀 ( ̄ε(# ̄) #○=(一-一o)

--
Tags: Linux

All Comments

Zenobia avatar
By Zenobia
at 2010-03-21T20:58
我猜 nslookup基本上是dns client,所以一定會去問dns
Kristin avatar
By Kristin
at 2010-03-23T13:03
nslookup - query Internet name servers interactively
Victoria avatar
By Victoria
at 2010-03-24T04:09
請問一下如果都會去查 DNS 那什麼時候才會去查hosts file呢
Skylar Davis avatar
By Skylar Davis
at 2010-03-24T11:00
/etc/init.d/nscd restart
Caroline avatar
By Caroline
at 2010-03-29T06:57
一般的ping就會先查/etc/hosts .. 你可以隨便key個ip和名字
測試一下就知道了
Ina avatar
By Ina
at 2010-04-02T09:28
簡言之..查詢順序一定是照nsswitch來,只是nslookup它已經
說明是拿來查詢dns用的工具..
Enid avatar
By Enid
at 2010-04-06T05:53
喔~這樣我了解了 謝謝您

Linux 系統時間校對

Charlie avatar
By Charlie
at 2010-03-18T19:17
※ 引述《kadok (暗夜流星)》之銘言: : ※ 引述《Adama (So Say We All.)》之銘言: : : 其實ntpdate要被淘汰了,改用ntpd : 沒這回事吧 : ntpdate是client端 : ntpd是server立 : 就算你安裝ntpd還是會安裝ntpdate,但ntpda ...

Linux 系統時間校對

Cara avatar
By Cara
at 2010-03-18T17:01
※ 引述《Adama (So Say We All.)》之銘言: : ※ 引述《rdmtb (每一天都是晴天)》之銘言: : : 只要一行指令 ,就能連桌面工具列的時間都調整同步: : : sudo ntpdate time.stdtime.gov.tw : : 如果只想知道時間: : : ntpdate - ...

Linux 系統時間校對

Sierra Rose avatar
By Sierra Rose
at 2010-03-18T15:54
※ 引述《rdmtb (每一天都是晴天)》之銘言: : 只要一行指令 ,就能連桌面工具列的時間都調整同步: : sudo ntpdate time.stdtime.gov.tw : 如果只想知道時間: : ntpdate -q time.stdtime.gov.tw 其實ntpdate要被淘汰了,改用ntp ...

awk 如何找出兩檔案相同字串

Cara avatar
By Cara
at 2010-03-18T15:02
while read line1 do temp1=$(echo $line1 | awk and#39;{print substr($1,1,3)}and#39;) while read line2 do temp2=$(ech ...

cron小偷懶

John avatar
By John
at 2010-03-18T14:31
作業系統是RHEL4.6 之前發生的一個問題,但總覺得解決方式不太好 問題是這樣的 cron裡頭有兩行 30 4 * * * 指令1 30 5 * * * 指令2 從某天起一連一個多禮拜不執行,找不到它的執行記錄 當天處理的時間約下午兩點半左右 把它改成 35 14 * * * 指令1 40 14 ...