Solve Host to IP without DNS

แปลง Host เป็น IP โดยไม่ต้องพึ่ง DNS Server ทำได้โดย ระบุในไฟล์ ชื่อ hosts
ของ Windows อยู่ที่ C:\WINDOWS\system32\drivers\etc\hosts
ของ linux อยู่ที่ /etc/hosts

รูปแบบคือ
IP ช่องว่างตามด้วย host

ตัวอย่างของ Windows

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost


อันนี้ของ linux
192.168.0.250 IF-Nikom.sci.com IF-Nikom
192.168.0.1 axaptaserver.sci.com axaptaserver
192.168.0.251 server1.sci.com server1
192.168.0.252 server2.sci.com server2
192.168.0.253 server3.sci.com server3


ตามหลักการก็น่าจะเร็วกว่าการใช้ dns ด้วย เพราะไม่ต้องวิ่งผ่าน server

Comments

Popular posts from this blog

Artillery Hornet + OctoPrint + Klipper

ย้ายบ้าน

ใต้ร่มกาสาวพัตร