or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
[筆記] 網路基礎概論-DNS Server
tags:
mentor-program
DNS server
今天我們在網址上輸入
github.com
,照理說就要能連到管理github.com
的這台主機,但是電腦看不懂github.com
,它只認得 IP 位址。就像跟計程車司機說:「我要去
中正紀念堂
」,假設司機不知道中正紀念堂在哪不知道怎麼去,這時它就要用Google Map
找中正紀念堂的地址,透過 Google Map 得知地址在台北市中正區中山南路21號
,這樣司機就知道在哪了。如果事先知道地址也能直接跟司機說:「我要去台北市中正區中山南路21號」,這樣就不用透過 Google Map 到目的地了。所以可以想成:
中正紀念堂 -> Domain Name
台北市中正區中山南路21號 -> Ip
Google Map -> DNS Server
所以簡單的來說,DNS Server 就是一個負責把 domain name 轉成 ip 位置的地方。
我們也能自己查詢 Ip
可以在 commane line 上輸入
得到的結果:
/etc/hosts
每個人的電腦裡都會有一個這樣的檔案,它會紀錄什麼 Ip 對應到什麼 domain,當我們在網址列上輸入 domain name 時,其實會優先在這個檔案裡搜尋,沒有的會才到 DNS server 查詢
這份檔案裡大概長這樣:
127.0.0.1
是個特殊的 Ip,就是指本機(自己電腦的主機)的意思補充:如何用 hosts 破解正版
假設是 adobe 軟體有個檢查是否是盜版的 request,假設 domain name 為 adobe.com ,而我們在 hosts 裡將 adobe.com 設為一個不存在的 ip 位址,這樣 request 就會被導到那個不存在的地方然後就沒有回應了(沒試過好想試)