DNS & DHCP on CentOS 5.7 4/12/54 อ. ดรัสวิน วงศ์ปรเมษฐ์
Infrastructure
How to Set Static IP /etc/sysconfig/networking/profile s/default/ifcfg-eth0 Install “ DNSMASQ ” packet Config /etc/hosts /etc/resolv.conf /etc/dnsmasq.conf Start Service “ DNSMASQ ”
Tools & Commands Tools Nano – Text Editor Commands ifconfig- view / add ip address nano- run nano editor rpm- operate packet rpm cd- go to directory ls- list file / folder in directory service- operate service chkconfig - check service nslookup- show dns server
Tools & Commands rpm - i- install -h, -v- show “#” while operate -e- erase/uninstall -nodeps- disable dependent other node -qa- list all installed packet other option | more- viwe more page
Tools & Commands #chkconfig --list level 0 - halt (Do NOT set initdefault to this) 1 - Single user mode 2 - Multiuser, without NFS (The same as 3, if you do not have networking) 3 - Full multiuser mode 4 - unused 5 - X reboot (Do NOT set initdefault to this)
How to Set Static IP #nano /etc/sysconfig/networking/profile s/default/ifcfg-eth0 # ifdown eth0 # ifup eth0
How to Install “ DNSMASQ ” packet #rpm -ivh dnsmasq el5.rfx.x86_64.rpm Unistall packet #rpm -evh --nodeps xxxxxxxx.rpm
How to Config #nano /etc/hosts
How to Config #nano /etc/resolv.conf
How to Config #nano /etc/dnsmasq.conf uncomment and set the following options expand-hosts domain=example.com dhcp- range= , , 12h dhcp- host=11:22:33:44:55:66,foo,
How to Start Service “ DNSMASQ ” #service dnsmasq start Check IP on your Client