Environment
- Apache as the web server. (In my server apache set to run in port 9000)
service accessed via http://server1/dnsmasq/login.php
- login.php
- admin.php - add/remove/modify host entries and update the DB
- admin.db - user logins
- db.php - DB connections
- hosts.db - host entry DB
- update.sh - updates the local hosts file when invoked from the PHP file
- dnsmasq.conf - replace dnsmasq initial file with this
* make sure to grant dnsmasq service reload access to apache user in visudo
# visudo
-- add below entry
apache ALL = NOPASSWD: /etc/init.d/dnsmasq reload
* current user in admin.db is "admin", password is "password"
to change the login or to add a user use below sql commands;
change admin user password --- sqlite3 admin.db "update logins set password='123456' where username='admin'"
add a user --- sqlite3 admin.db "insert into logins (username,password) values ('admin','password')"
https://github.com/lahiruprasad/dnsmasq-php/blob/gh-pages/dnsmasq.zip
https://github.com/lahiruprasad/dnsmasq-php/blob/gh-pages/dnsmasq.conf
https://github.com/lahiruprasad/dnsmasq-php/blob/gh-pages/dnsmasq.conf