Posts

Showing posts with the label DNS

Pi-Hole : Ads blocking via Raspberry Pi

Pi-Hole : Ads blocking via Raspberry Pi :  https://pi-hole.net/ - ปิดโฆษณาในระดับเครือข่าย คือ ปิดสำหรับทุกอุปกรณ์ที่เชื่อมต่อ - โฆษณา อ่านว่า โคด-สะ-นา มีเทคนิคให้จำได้จนขึ้นใจ คือ เจอคำนี้ให้คิดถึงโคตรพ่อโคตรแม่ไว้ จะอ่านถูก - ติดตั้งง่ายมาก ใช้คำสั่งเดียว คือ  curl -sSL https://install.pi-hole.net | bash - หลังจากติดตั้งแล้วจะได้รหัสผ่านสำหรับ login เข้าเมนู admin ต้องจำไว้ให้ดี ถ้าจำไม่ได้ต้องใช้คำสั่ง sudo pihole -a -p เพื่อสร้างรหัสใหม่ - ก่อนจะติดตั้ง ต้องบอกก่อนว่า pihole ทำงานผ่าน lighttpd บนพอร์ท 80 ถ้าใช้ apache อยู่ก่อนแล้วอาจมีปัญหา - หลังจากติดตั้งก็แล้วก็ตั้งค่า Router ให้จ่าย DHCP โดยใช้ pihole เป็น DNS - ถ้าตั้งค่าที่ Router ไม่ได้ ก็มาตั้งที่ pihole ซึ่งสามารถจ่าย DHCP  ได้ด้วย - บางเกมส์ใน Android ที่เปิดโอกาสให้ดู VDO เพื่อรับ Item หรือ Promotion พิเศษอาจจะถูก blocked ไปด้วย ต้อง login เข้าไป Disable Pi-hole ชั่วคราว

Ubuntu : Internet Sharing

#nano /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet static address 192.168.1.10 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 post-up /usr/local/bin/iptable.sh #nano /usr/local/bin/iptable.sh #!/bin/bash echo 1 > /proc/sys/net/ipv4/ip_forward iptables -F iptables -t nat -F iptables -t mangle -F iptables -X iptables -P FORWARD ACCEPT iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE #apt-get install squid3 #nano /etc/squid3/squid.conf http_port 8080 transparent acl localnet src 192.168.1.0/24 http_access allow localnet http_access deny all #apt-get install dnsmasq #nano /etc/dnsmasq.conf interface=eth1 dhcp-range=192.168.1.11,192.168.1.20,12h script : share-net-script

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....