❶ 涓嶆噦灝遍棶涓嬬粺淇″浘褰㈢晫闈㈡庝箞璁劇疆鍙岀綉鍗$粦瀹氾紝灝辨槸鏈嶅姟鍣ㄦ搷浣滅郴緇燂紵
鍔熻兘姒傝堪
濡傛灉瀹㈡埛鐜板満浣跨敤鐨勬槸鍙岀綉鍗$粦瀹氶厤緗緗戠粶錛岄渶瑕佹妸涓ゆ牴緗戝崱鍋氱粦瀹氾紝姝ょ嶇粦瀹氭柟寮忕О涓衡滅儹澶団濓紝鍗砨ond1妯″紡錛屽湪緇熶俊鎿嶄綔緋葷粺涓鎻愪緵浜嗗浘褰㈠寲鎿嶄綔鐣岄潰緇戝畾緗戝崱鐨勬柟娉曘
鎿嶄綔姝ラ
1銆佸湪鎿嶄綔涓蹇-緗戠粶-鏈夌嚎緗戠粶涓錛岀偣鍑諱笅鏂圭殑鐢ㄧ綉緇滅$悊鍣ㄩ厤緗錛
2銆佹墦寮緗戠粶綆$悊鍣ㄩ厤緗鍚庡備笅鍥撅細
3銆佺偣鍑誨乏涓嬭掔殑鈥+鈥
閫夋嫨榪炴帴綾誨瀷涓虹粦瀹氾紝鐒跺悗鐐瑰嚮鍙充笅瑙掔殑create鎸夐挳錛
4銆佸湪鈥滅粦瀹氳繛鎺1鈥濈晫闈錛岀偣鍑籥dd鎸夐挳錛屾妸闇瑕佺粦瀹氫袱涓緗戝崱娣誨姞榪涘幓錛宮ode閫夋嫨鈥滅儹澶団濓細
5銆佺偣鍑燴淚PV4璁劇疆閫夐」鍗♀濓紝method閫夋嫨鎵嬪姩錛屽湪鍦板潃鏍忕偣鍑籥dd鎸夐挳錛岃緭鍏ユ湇鍔″櫒鐩稿叧鐨剗p錛屽瓙緗戞帺鐮侊紝緗戝叧淇℃伅錛
6銆侀厤緗瀹屾垚鍚庣偣鍑諱繚瀛樻寜閽錛屽畬鎴愬弻緗戝崱緇戝畾璁劇疆銆傞厤緗瀹屾垚鍚庡彲鍦ㄦ湇鍔″櫒鍛戒護琛宲ing緗戝叧錛屽苟浜ゆ浛鎷旀帀涓涓鍏夌氦緗戠嚎嫻嬭瘯緗戠粶鏄鍚﹂氱晠銆
❷ 鑳藉惁鎸囧間竴涓嬪湪緇熶俊鏈嶅姟鍣ㄤ笂閰嶇疆Dnsmasq浣滀負DNS鏈嶅姟鍣ㄧ殑鍏蜂綋姝ラわ紵
鍔熻兘浠嬬粛
Dnsmasq鎻愪緵DNS緙撳瓨鍜孌HCP鏈嶅姟銆乀ftp鏈嶅姟鍔熻兘錛
1銆佷綔涓哄煙鍚嶈В鏋愭湇鍔″櫒(DNS)錛孌nsmasq鍙浠ラ氳繃緙撳瓨DNS璇鋒眰鏉ユ彁楂樺硅塊棶榪囩殑緗戝潃鐨勮繛鎺ラ熷害錛
2銆佷綔涓篋HCP鏈嶅姟鍣錛孌nsmasq鍙浠ヤ負灞鍩熺綉鐢佃剳鎻愪緵鍐呯綉ip鍦板潃鍜岃礬鐢憋紱
DNS鍜孌HCP涓や釜鍔熻兘鍙浠ュ悓鏃舵垨鍒嗗埆鍗曠嫭瀹炵幇銆侱nsmasq杞婚噺涓旀槗閰嶇疆錛岄傜敤浜庝釜浜虹敤鎴鋒垨灝戜簬50鍙頒富鏈虹殑緗戠粶錛屾ゅ栧畠榪樿嚜甯︿簡涓涓狿XE鏈嶅姟鍣ㄣ
瀹夎呮ラ
姝ラや竴錛氬畨瑁 Dnsmasq
# UOS d鐗
$ apt install dnsmasq
# UOS a/e鐗
$ yum install dnsmasq
姝ラや簩錛氶厤緗鏂囦歡璇存槑
Dnsmasq閰嶇疆鏂囦歡鏄/etc/dnsmasq.conf錛屼笅闈㈠笵nsmasq涓鍜孌NS鐩稿叧鐨勯厤緗欏硅繘琛岃存槑錛
# 濡傛灉璁劇疆涓0錛屽垯瀹屽叏紱佹DNS鍔熻兘錛屽彧浣跨敤dhcp鏈嶅姟
port=5353
# 浠庝笉杞鍙戞牸寮忛敊璇鐨勫煙鍚
#domain-needed
# 浠庝笉杞鍙戜笉鍦ㄨ礬鐢卞湴鍧涓鐨勫煙鍚
#bogus-priv
# resolv-file閰嶇疆Dnsmasq棰濆栫殑涓婃父DNS鏈嶅姟鍣錛屽傛灉涓嶅紑鍚灝變嬌鐢╨inux涓繪満榛樿ょ殑/etc/resolv.conf閲岀殑nameserver錛岄氳繃涓嬮潰鐨勯夐」鎸囧畾鍏朵粬鏂囦歡銆
resolv-file=/etc/dnsmasq.d/upstream_dns.conf
# 榛樿ゆ儏鍐典笅Dnsmasq浼氬彂閫佹煡璇㈠埌瀹冪殑浠諱綍涓婃父DNS鏈嶅姟鍣ㄤ笂錛屽傛灉鍙栨秷娉ㄩ噴錛屽垯Dnsmasq鍒欎細涓ユ牸鎸夌収/etc/resolv.conf涓鐨凞NS Server欏哄簭榪涜屾煡璇銆
#strict-order
# 涓嶈誨彇 resolv-file 鏉ョ『瀹氫笂娓告湇鍔″櫒
#no-resolv
# 涓嶈佹嫻 /etc/resolv.conf 鐨勫彉鍖
#no-poll
# 澧炲姞涓涓猲ame server錛屼竴鑸鐢ㄤ簬鍐呯綉鍩熷悕
#server=/localnet/192.168.0.1
# 璁劇疆涓涓鍙嶅悜瑙f瀽錛屾墍鏈192.168.3.0/24鐨勫湴鍧閮藉埌10.1.2.3鍘昏В鏋
#server=/3.168.192.in-addr.arpa/10.1.2.3
# 澧炲姞涓涓鏈鍦板煙鍚嶏紝浼氬湪/etc/hosts涓榪涜屾煡璇
#local=/localnet/
# 澧炲姞涓涓鍩熷悕錛屽己鍒惰В鏋愬埌浣犳寚瀹氱殑鍦板潃涓
#address=/double-click.net/127.0.0.1
# 鍚屼笂錛岃繕鏀鎸乮pv6
#address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83
# 澧炲姞鏌ヨyahoo google鍜屽畠浠鐨勫瓙鍩熷悕鍒皏pn銆乻earch鏌ユ壘
# 浣犺繕鍙浠ユ帶鍒禗nsmasq鍜孲erver涔嬮棿鐨勬煡璇浠庡摢涓緗戝崱鍑哄幓
# server=10.1.2.3@eth1
# 鎸囧畾婧愬湴鍧鎼哄甫10.1.2.3鍦板潃鍜192.168.1.1鐨55絝鍙h繘琛岄氳
# 鏀瑰彉Dnsmasq榛樿ょ殑uid鍜実id
#user=
#group=
# 濡傛灉浣犳兂Dnsmasq鐩戝惉鏌愪釜絝鍙d負dhcp銆乨ns鎻愪緵鏈嶅姟
#interface=
# 浣犺繕鍙浠ユ寚瀹氬摢涓絝鍙d綘涓嶆兂鐩戝惉
#except-interface=
# 璁劇疆鎯崇洃鍚鐨勫湴鍧錛屽傛灉浣犳湰鏈鴻佷嬌鐢ㄥ啓涓127.0.0.1銆
#listen-address=
# 濡傛灉浣犳兂鍦ㄦ煇涓絝鍙e彧鎻愪緵dns鏈嶅姟錛屽垯鍙浠ヨ繘琛岄厤緗紱佹dhcp鏈嶅姟
#no-dhcp-interface=
#bind-interfaces
# 濡傛灉浣犱笉鎯充嬌鐢/etc/hosts錛屽垯鍙栨秷涓嬮潰鐨勬敞閲
#no-hosts
# 濡傛灉浣犻」璇誨彇鍏朵粬綾諱技/etc/hosts鏂囦歡錛屽垯榪涜岄厤緗
addn-hosts=/etc/banner_add_hosts
# 鑷鍔ㄧ殑緇檋osts涓鐨刵ame澧炲姞涓涓鍩熷悕
#expand-hosts
# 鑷鍔ㄥ姞杞絚onf-dir鐩褰曚笅鐨勯厤緗鏂囦歡
conf-dir=/etc/dnsmasq.d
# 璁劇疆dns緙撳瓨澶у皬,榛樿や負150鏉
cache-size=150
閰嶇疆紺轟緥
姝ラや竴錛氶厤緗涓婃父鏈嶅姟鍣ㄥ湴鍧
resolv-file閰嶇疆Dnsmasq棰濆栫殑涓婃父鐨凞NS鏈嶅姟鍣錛屽傛灉涓嶅紑鍚灝變嬌鐢↙inux涓繪満榛樿ょ殑/etc/resolv.conf閲岀殑nameserver銆
閫氳繃涓嬮潰鐨勯夐」鎸囧畾鍏朵粬鏂囦歡鏉ョ$悊涓婃父鐨凞NS鏈嶅姟鍣錛屼慨鏀/etc/dnsmasq.conf 閰嶇疆鏂囦歡錛
resolv-file=/etc/resolv.dnsmasq.conf
鍦ㄦ寚瀹氭枃浠朵腑澧炲姞杞鍙慏NS鐨勫湴鍧錛屼慨鏀/etc/resolv.dnsmasq.conf 鏂囦歡錛
nameserver 8.8.8.8
nameserver 8.8.4.4
鏈鍦板惎鐢―nsmasq瑙f瀽錛屼慨鏀 /etc/resolv.conf 鏂囦歡錛
nameserver 127.0.0.1
姝ラや簩錛氭坊鍔犺В鏋愯板綍
1銆佷嬌鐢ㄧ郴緇熼粯璁hosts錛屼慨鏀 /etc/hosts 鏂囦歡錛
127.0.0.1 localhost
192.168.101.107 web01.mike.com web01
192.168.101.107 web02.mike.com web02
2銆佷嬌鐢ㄨ嚜瀹氫箟hosts鏂囦歡錛屼慨鏀/etc/dnsmasq.conf 閰嶇疆鏂囦歡錛屽炲姞鑷瀹氫箟 hosts 鏂囦歡浣嶇疆錛
addn-hosts=/etc/dnsmasq.hosts
鏂板緩/etc/dnsmasq.hosts鏂囦歡錛屾坊鍔燚NS璁板綍錛
192.168.101.107 web01.mike.com web01
192.168.101.107 web02.mike.com web02
3銆佷嬌鐢ㄨ嚜瀹氫箟conf錛屾柊寤 /etc/dnsmasq.d/address.conf 鏂囦歡騫惰板綍濡備笅鍐呭癸細
# 鎸囧畾dnsmasq榛樿ゆ煡璇㈢殑涓婃父鏈嶅姟鍣錛屾ゅ勪互Google Public DNS涓轟緥銆
server=8.8.8.8
server=8.8.4.4
# 鎶婃墍鏈.cn鐨勫煙鍚嶅叏閮ㄩ氳繃114.114.114.114榪欏彴鍥藉唴DNS鏈嶅姟鍣ㄦ潵瑙f瀽
server=/cn/114.114.114.114
# 緇檃pple.com鍜宼aobao.com浣跨敤涓撶敤鐨凞NS
server=/taobao.com/223.5.5.5
server=/apple.com/223.5.5.5
# 鎶www.hi-linux.com瑙f瀽鍒扮壒瀹氱殑IP
address=/www.hi-linux.com/192.168.101.107
# 鍦ㄨ繖閲宧i-linux.com鐩稿綋浜*.hi-linux.com娉涜В鏋
address=/hi-linux.com/192.168.101.107
娉ㄦ槑錛氫篃鍙浠ョ洿鎺ユ坊鍔犲埌/etc/dnsmasq.conf涓,涓嶈繃/etc/dnsmasq.d/*.conf鐨勪紭鍏堢駭澶т簬/etc/dnsmasq.conf銆
姝ラや笁錛氬惎鍔―nsmasq
1銆佸惎鍔ㄦ湇鍔★細
$ systemctl restart dnsmasq
2銆佹祴璇暘nsmasq瑙f瀽鏁堟灉錛
$ dig @192.168.101.104 www.hi-linux.com
❸ 統信 UOS 無線 感嘆號 上網
打開網路和INERENT設置。
打開之後點擊「更改適配器選項」,然後右擊無線網路圖標選擇「禁用」,黃色感嘆號消失沒有。再點擊右擊無線網路圖標選擇「啟用」,右擊無線網路圖標點擊「屬性」。
然後找到IPV4並點擊「屬性」。
最後一步,將圖示的進行勾選之後並點擊「確定」。