2023年1月4日 星期三

測試Linux硬碟的讀取效能

測試硬碟sda速度 

# hdparm -Tt /dev/sda






sda是SATA的硬碟,速度178MB,這顆是Hitachi的1TB,7200轉企業級硬碟。

查詢硬碟sda的smart狀態

# smartctl -i /dev/sda



使用nslookup指令檢查DNS狀態

有時候DNS名稱解析不正常,導致一些網站無法連上,藉由 Windows的命令列模式,可以使用nslookup指令來偵錯。

1.開始→執行→輸入cmd→確定

2.輸入nslookup,看到 > 提示符號, 此時打?就會出現 nslookup的說明

C:\>nslookup
Default Server:  dns.bles.tp.edu.tw
Address:  163.21.102.231

> ?
Commands:   (identifiers are shown in uppercase, [] means optional)
NAME            - print info about the host/domain NAME using default server
NAME1 NAME2     - as above, but use NAME2 as server
help or ?       - print info on common commands
set OPTION      - set an option
    all                 - print options, current server and host
    [no]debug           - print debugging information
    [no]d2              - print exhaustive debugging information
    [no]defname         - append domain name to each query
    [no]recurse         - ask for recursive answer to query
    [no]search          - use domain search list
    [no]vc              - always use a virtual circuit
    domain=NAME         - set default domain name to NAME
    srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2, etc.
    root=NAME           - set root server to NAME
    retry=X             - set number of retries to X
    timeout=X           - set initial time-out interval to X seconds
    type=X              - set query type (ex. A,ANY,CNAME,MX,NS,PTR,SOA,SRV)
    querytype=X         - same as type
    class=X             - set query class (ex. IN (Internet), ANY)
    [no]msxfr           - use MS fast zone transfer
    ixfrver=X           - current version to use in IXFR transfer request
server NAME     - set default server to NAME, using current default server
lserver NAME    - set default server to NAME, using initial server
finger [USER]   - finger the optional NAME at the current default host
root            - set current default server to the root
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)
    -a          -  list canonical names and aliases
    -d          -  list all records
    -t TYPE     -  list records of the given type (e.g. A,CNAME,MX,NS,PTR etc.)
view FILE           - sort an 'ls' output file and view it with pg
exit            - exit the program

>

3.查詢外部網站(yahoo),看DNS是否正常,本例中為正常狀況

> tw.yahoo.com
Server:  dns.bles.tp.edu.tw
Address:  163.21.102.231

Non-authoritative answer:
Name:    tw-tpc-fo.yahoo-ap1.akadns.net
Address:  203.84.202.164
Aliases:  tw.yahoo.com, tw-cidr.yahoo-ap1.akadns.net

4.切換至市網中心的DNS server

> server 163.21.249.167
Default Server:  dns2.tp.edu.tw
Address:  163.21.249.167

5.查詢bles.tp.edu.tw網域的MX紀錄

> set type=MX
> bles.tp.edu.tw
Server:  dns2.tp.edu.tw
Address:  163.21.249.167

bles.tp.edu.tw  MX preference = 10, mail exchanger = ASPMX2.GOOGLEMAIL.COM
bles.tp.edu.tw  MX preference = 10, mail exchanger = ASPMX3.GOOGLEMAIL.COM
bles.tp.edu.tw  MX preference = 10, mail exchanger = ASPMX4.GOOGLEMAIL.COM
bles.tp.edu.tw  MX preference = 10, mail exchanger = ASPMX5.GOOGLEMAIL.COM
bles.tp.edu.tw  MX preference = 1, mail exchanger = ASPMX.L.GOOGLE.COM
bles.tp.edu.tw  MX preference = 5, mail exchanger = ALT1.ASPMX.L.GOOGLE.COM
bles.tp.edu.tw  MX preference = 5, mail exchanger = ALT2.ASPMX.L.GOOGLE.COM
bles.tp.edu.tw  nameserver = dns.bles.tp.edu.tw
bles.tp.edu.tw  nameserver = dns2.tp.edu.tw
ASPMX2.GOOGLEMAIL.COM   internet address = 209.85.135.27
dns.bles.tp.edu.tw      internet address = 163.21.102.231
dns2.tp.edu.tw  internet address = 163.21.249.167

很好,已經將MX紀錄轉換成 Gmail的主機了

6.結束查詢
> exit

清除DNS快取

原本的www主機已經改名www2了,在DNS更改了IP的對應,nslookup已經OK,但是在Windows的使用者端卻無法正確連線,原來是沒有清除使用者電腦的dns cache,清除指令如下:

ipconfig /flushdns

清除後再次測試就OK了,可以正確連線。 

ESXi更新步驟

教育局配發 DELL R640的VMware ESXi版本,該更新一下了! https://www.vmware.com/security/advisories/VMSA-2022-0030.html 更新步驟: https://drive.google.com/file/d/...