Memo/Linux/dnsmasq
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
#contents
*dnsmasq [#mb9a0cb5]
- [[imp/dnsmasq: Mirror of the upstream dnsmasq repositor...
----
** 脆弱性 [#a56e5cfc]
- 記事
-- [[DNSpooqの脆弱性詳細と攻撃コード解説 - knqyf263's blo...
----
** 検証 [#v2fe400f]
- nslookupを使う。
#geshi(bash){{
nslookup int.example.com
}}
- digを使う
#geshi(bash){{
# 明示的にNSとしてlocalhostを指定。NSを変えれば、dnsmasq...
dig @localhost int.example.com
# google public dns (8.8.8.8, 8.8.4.4)
dig @8.8.8.8 int.example.com
}}
----
** よく使うオプション [#z2bbed4c]
- [[Man page of DNSMASQ:http://www.thekelleys.org.uk/dnsm...
- address=/<domain>[/<domain>...]/[<ipaddr>]
-- アドレスの上書き
-- *.example.com の問い合わせで 192.168.1.10 を返す
#geshi(text){{
address=/.example.com/192.168.1.10
}}
- server=[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<sour...
-- 指定ドメインだけ別のネームサーバを返す
#geshi(text){{
# 正引き用
server=/int.example.com/192.168.2.254
# 逆引き用
server=/2.168.192.in-addr.arpa/192.168.2.254
}}
----
** クエリログを出力 [#hc063995]
- lookupされるとsyslog等にログを残せる。
- ログサイズが大きくなるので注意
- syslogに出力
#geshi(text){{
sudo vim /etc/dnsmasq.conf
--
log-queries
log-facility=local0
#log-facility=/var/log/dnsmasq.log
--
sudo service dnsmasq restart
nslookup dummy.example.com
sudo tail /var/log/messages
}}
----
**white list式 [#bcb821c4]
許可したDNSだけ名前解決して、それ以外はlocalhostのアドレ...
- "#" がワイルドカード
-記事
--[[Dnsmasq Whitelist:http://www.intellamech.com/Raspberr...
--[[linux - DNS-Block All Websites Except for Whitelisted...
#geshi(bash){{
sudo vim /etc/dnsmasq.conf
----
conf-dir=/etc/dnsmasq.d,*.conf
----
sudo vim /etc/dnsmasq.d/whitelist.conf
----
server=/allowed.example.com/8.8.8.8
address=/#/127.0.0.1
----
sudo service dnsmasq restart
}}
----
**dnsmasqで内向きDNS [#x0c34cf3]
-記事
--[[dnsmasqでDNSおよびDHCPサービスを強化する - SourceForg...
-http://group.example.com/ -> http://192.168.1.200/ を返...
-bindは面倒なので、dnsmasqで代用
-インストール
#geshi(bash){{
yum install -y dnsmasq
vi /etc/resolv.conf
----
nameserver 127.0.0.1
nameserver 192.168.1.1
----
vi /etc/hosts
----
192.168.1.200 group.example.com
----
service dnsmasq restart
chkconfig dnsmasq on
}}
-hostsを変更したら再読込
#geshi(bash){{
service dnsmasq reload
}}
終了行:
#contents
*dnsmasq [#mb9a0cb5]
- [[imp/dnsmasq: Mirror of the upstream dnsmasq repositor...
----
** 脆弱性 [#a56e5cfc]
- 記事
-- [[DNSpooqの脆弱性詳細と攻撃コード解説 - knqyf263's blo...
----
** 検証 [#v2fe400f]
- nslookupを使う。
#geshi(bash){{
nslookup int.example.com
}}
- digを使う
#geshi(bash){{
# 明示的にNSとしてlocalhostを指定。NSを変えれば、dnsmasq...
dig @localhost int.example.com
# google public dns (8.8.8.8, 8.8.4.4)
dig @8.8.8.8 int.example.com
}}
----
** よく使うオプション [#z2bbed4c]
- [[Man page of DNSMASQ:http://www.thekelleys.org.uk/dnsm...
- address=/<domain>[/<domain>...]/[<ipaddr>]
-- アドレスの上書き
-- *.example.com の問い合わせで 192.168.1.10 を返す
#geshi(text){{
address=/.example.com/192.168.1.10
}}
- server=[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<sour...
-- 指定ドメインだけ別のネームサーバを返す
#geshi(text){{
# 正引き用
server=/int.example.com/192.168.2.254
# 逆引き用
server=/2.168.192.in-addr.arpa/192.168.2.254
}}
----
** クエリログを出力 [#hc063995]
- lookupされるとsyslog等にログを残せる。
- ログサイズが大きくなるので注意
- syslogに出力
#geshi(text){{
sudo vim /etc/dnsmasq.conf
--
log-queries
log-facility=local0
#log-facility=/var/log/dnsmasq.log
--
sudo service dnsmasq restart
nslookup dummy.example.com
sudo tail /var/log/messages
}}
----
**white list式 [#bcb821c4]
許可したDNSだけ名前解決して、それ以外はlocalhostのアドレ...
- "#" がワイルドカード
-記事
--[[Dnsmasq Whitelist:http://www.intellamech.com/Raspberr...
--[[linux - DNS-Block All Websites Except for Whitelisted...
#geshi(bash){{
sudo vim /etc/dnsmasq.conf
----
conf-dir=/etc/dnsmasq.d,*.conf
----
sudo vim /etc/dnsmasq.d/whitelist.conf
----
server=/allowed.example.com/8.8.8.8
address=/#/127.0.0.1
----
sudo service dnsmasq restart
}}
----
**dnsmasqで内向きDNS [#x0c34cf3]
-記事
--[[dnsmasqでDNSおよびDHCPサービスを強化する - SourceForg...
-http://group.example.com/ -> http://192.168.1.200/ を返...
-bindは面倒なので、dnsmasqで代用
-インストール
#geshi(bash){{
yum install -y dnsmasq
vi /etc/resolv.conf
----
nameserver 127.0.0.1
nameserver 192.168.1.1
----
vi /etc/hosts
----
192.168.1.200 group.example.com
----
service dnsmasq restart
chkconfig dnsmasq on
}}
-hostsを変更したら再読込
#geshi(bash){{
service dnsmasq reload
}}
ページ名: