diff -Nur a/src/dns_block.c b/src/dns_block.c
--- a/src/dns_block.c	1970-01-01 08:00:00.000000000 +0800
+++ b/src/dns_block.c	2018-11-27 19:05:43.718695072 +0800
@@ -0,0 +1,414 @@
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netdb.h>
+#include <poll.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include "dnsmasq.h"
+#include <linux/rtnetlink.h>
+
+#define ANOMALY_DOMAIN		"/tmp/dnsblock.domain"
+#define LEASE_CMD			0
+#define LEASE_CMD_ADD_U		0
+#define LEASE_CMD_DEL_U		1
+#define LEASE_KEY_NUM		7
+#define LEASE_KEY_MAX_LEN	16
+
+typedef struct dev {
+	char mac[6];
+	struct dev *next;
+}LDEV;
+
+char lease_key[LEASE_KEY_NUM][LEASE_KEY_MAX_LEN] = {"siflower","apple","alipay","alicdn","taobao","tenpay","wx.gtimg"};
+extern struct mac_node * gpmac_list_hdr;
+LDEV *head = NULL;
+pthread_mutex_t llist_lock = PTHREAD_MUTEX_INITIALIZER;
+
+#ifdef HAVE_IPV6
+int get_mac_ipv6( struct in6_addr* pipv6_src, unsigned char * pmac)
+{
+    int fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+    int status;
+//send request via netlink, the message is in req
+    struct {
+        struct nlmsghdr n;
+        struct ndmsg r;
+    } req;
+
+	char ipv6_str[INET6_ADDRSTRLEN] = {'\0'};
+	inet_ntop(AF_INET6, pipv6_src, ipv6_str, INET6_ADDRSTRLEN);
+	// my_syslog(LOG_WARNING, _("ipv6 src is: %s \n"),ipv6_str);
+    memset(&req, 0, sizeof(req));
+    // fill in the netlink message header
+    req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg));
+    req.n.nlmsg_type = RTM_GETNEIGH;
+    req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
+    // fill in the netlink message GETNEIGH
+    req.r.ndm_family = AF_INET6;
+
+    status = send(fd, &req, req.n.nlmsg_len, 0);
+    if (status < 0){
+		close(fd);
+		my_syslog(LOG_WARNING, _("rtl send failed\n"));
+		return -1;
+	}
+
+    //receive data and put it in buf
+    char buf[4096];
+    char *p;
+    struct nlmsghdr *nlp;
+    memset(buf, 0, sizeof(buf));
+    p = buf;
+    int nll = 0;
+    struct ndmsg *ndp;
+    struct rtattr *ndap;
+    int ndl;
+
+    while(1)
+    {
+            status = recv(fd, p, sizeof(buf) - nll, 0);
+            if (status < 0){
+				my_syslog(LOG_WARNING, _("receive msg failed\n"));
+				close(fd);
+				return -2;
+			}
+
+            nlp = (struct nlmsghdr *) p;
+            if(nlp->nlmsg_type == NLMSG_DONE) {
+				my_syslog(LOG_WARNING, _("get all message\n"));
+				break;
+            }
+            while(1)
+            {
+                    ndp = (struct ndmsg *) NLMSG_DATA(nlp);     // get RTNETLINK message header
+                    ndap = (struct rtattr *) RTM_RTA(ndp);      // get start of attributes
+                    ndl = RTM_PAYLOAD(nlp);
+                    while(1) {
+                        if (ndap->rta_type == NDA_DST) {
+							memset(ipv6_str, '\0', INET6_ADDRSTRLEN);
+							struct in6_addr *pipv6_get = RTA_DATA(ndap);
+							if(pipv6_get->s6_addr[0] !=  0xFF){
+								inet_ntop(AF_INET6, pipv6_get,ipv6_str, INET6_ADDRSTRLEN);
+								// my_syslog(LOG_WARNING, _("ipv6 is: %s \n"),ipv6_str);
+								if (memcmp(pipv6_get->s6_addr, pipv6_src->s6_addr, 16) == 0) {
+									ndap = RTA_NEXT(ndap, ndl);
+									memcpy(pmac,RTA_DATA(ndap),6);
+									close(fd);
+									return 2;
+								}
+							}
+							else
+							  break;
+						}
+						ndap = RTA_NEXT(ndap, ndl);
+						if (RTA_OK(ndap, ndl) != 1)
+						{
+							break;
+						}
+
+					}
+					p += status;
+					nll += status;
+					nlp = NLMSG_NEXT(nlp, nll);
+					if (NLMSG_OK(nlp, nll) != 1)
+					{
+						break;
+					}
+			}
+	}
+	close(fd);
+
+	return 0;
+}
+#endif
+
+int get_mac_by_ip(unsigned char* mac,  struct sockaddr *sa){
+	int sock_fd = 0, ret = 0;
+	struct arpreq req;
+	memset(&req, 0, sizeof(struct arpreq));
+	// set ip
+	memcpy(&req.arp_pa, sa, sizeof(struct sockaddr));
+	// set interface
+	strncpy(req.arp_dev, "br-lease", sizeof(req.arp_dev));
+	sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
+	if(sock_fd < 0)
+	{
+		my_syslog(LOG_WARNING, _("%s open socket fail.\n"), __FUNCTION__);
+		return -1;
+	}
+
+	ret = ioctl(sock_fd, SIOCGARP, &req);
+	close(sock_fd);
+	if(ret < 0)
+	{
+		my_syslog(LOG_WARNING, _("ioctl error.\n"));
+		return -1;
+	}
+	memcpy(mac, &req.arp_ha.sa_data, 6);
+	return 0;
+}
+
+
+int filter_by_mac(void *sa, struct mac_node **ppmac_node, char is_ipv6){
+	unsigned char mac[6] = {0};
+	struct sockaddr_in * psin;
+#ifdef HAVE_IPV6
+	if (is_ipv6){
+		if(get_mac_ipv6(sa,mac) != 2){
+			// my_syslog(LOG_WARNING, _("cannot find mac for ipv6"));
+			return 1;
+		}
+		else{
+			// my_syslog(LOG_WARNING, _("mac is %02x:%02x:%02x:%02x:%02x:%02x"), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+		}
+	}
+	else{
+#endif
+		// memcpy(&sin, sa, sizeof(sin));
+		psin = sa;
+		if(psin->sin_addr.s_addr == inet_addr("127.0.0.1"))
+		  return 0;
+		// my_syslog(LOG_ERR, _("addr:%s, port:%d\n"), inet_ntoa(psin>sin_addr), ntohs(psin>sin_port));
+
+		if(get_mac_by_ip(mac, sa) < 0){
+			// my_syslog(LOG_WARNING, _("cannot find mac for ip"));
+			return 1;
+		}
+		else{
+			// my_syslog(LOG_WARNING, _("mac is %02x:%02x:%02x:%02x:%02x:%02x"), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+		}
+#ifdef HAVE_IPV6
+	}
+#endif
+
+	if((*ppmac_node = find_mac_node(mac, gpmac_list_hdr)) == NULL) {
+		// my_syslog(LOG_WARNING, _("get null"));
+		return 2;
+	}
+	return 0;
+}
+
+int lease_find_mac(char *mac){
+	LDEV *dev;
+	pthread_mutex_lock(&llist_lock);
+	for(dev = head->next; dev != NULL; dev = dev->next){
+		if(memcmp(mac, dev->mac, 6) == 0){
+			SLOG("%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx",mac[0], mac[1],mac[2], mac[3], mac[4], mac[5]);
+			pthread_mutex_unlock(&llist_lock);
+			SLOG("Find devcie");
+			return 1;
+		}
+	}
+	pthread_mutex_unlock(&llist_lock);
+	return 0;
+}
+
+int lease_filter_by_mac(void *sa, char is_ipv6){
+	unsigned char mac[6] = {0};
+	struct sockaddr_in * psin;
+#ifdef HAVE_IPV6
+	if (is_ipv6){
+		if(get_mac_ipv6(sa,mac) != 2){
+			// my_syslog(LOG_WARNING, _("cannot find mac for ipv6"));
+			return -1;
+		}
+		else{
+			// my_syslog(LOG_WARNING, _("mac is %02x:%02x:%02x:%02x:%02x:%02x"), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+		}
+	}
+	else{
+#endif
+		// memcpy(&sin, sa, sizeof(sin));
+		psin = sa;
+		if(psin->sin_addr.s_addr == inet_addr("127.0.0.1"))
+		  return 0;
+		// my_syslog(LOG_ERR, _("addr:%s, port:%d\n"), inet_ntoa(psin->sin_addr), ntohs(psin->sin_port));
+
+		if(get_mac_by_ip(mac, sa) < 0){
+			// my_syslog(LOG_WARNING, _("cannot find mac for ip"));
+			return -1;
+		}
+		else{
+			// my_syslog(LOG_WARNING, _("mac is %02x:%02x:%02x:%02x:%02x:%02x"), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+		}
+#ifdef HAVE_IPV6
+	}
+#endif
+
+	return lease_find_mac(mac);
+}
+
+/*return 2 drop dns request*/
+int lease_dns_block(char *namebuff, void *s, char is_ipv6){
+	char i;
+
+	if(lease_filter_by_mac(s, is_ipv6) == 1){
+		for(i=0; i < LEASE_KEY_NUM; ++i){
+			SLOG("key is %s",lease_key[i]);
+			if(strstr(namebuff, lease_key[i]) != NULL){
+				return 1;
+			}
+		}
+		/*found device, not include keys*/
+		return 2;
+	}
+	/*not found device*/
+	return 0;
+}
+
+int deal_lease_cmd(char *buf){
+	int cmd = -1;
+	unsigned char have = 0;
+	cmd = buf[0];
+	char *mac = buf+1;
+	LDEV *dev = NULL;
+	LDEV *pdev = NULL;
+
+
+	switch(cmd){
+		case LEASE_CMD_ADD_U:
+			for(dev = head->next; dev != NULL; dev = dev->next){
+				if(memcmp(mac, dev->mac, 6) == 0){
+					have = 1;
+					SLOG("Add device is exist");
+					break;
+				}
+			}
+			if(have == 0){
+				dev = malloc(sizeof(LDEV));
+				if(dev == NULL){
+					SLOG("Add device malloc fail!");
+					return 0;
+				}
+				memcpy(dev->mac, mac, 6);
+				pthread_mutex_lock(&llist_lock);
+				dev->next = head->next;
+				head->next = dev;
+				pthread_mutex_unlock(&llist_lock);
+				SLOG("Add device is success");
+			}
+			break;
+		case LEASE_CMD_DEL_U:
+			pdev = head;
+			for(dev = head->next; dev != NULL; dev = dev->next){
+				if(memcmp(mac, dev->mac, 6) == 0){
+					have = 1;
+					break;
+				}
+				pdev = dev;
+			}
+			if(have == 1){
+				pthread_mutex_lock(&llist_lock);
+				pdev->next = dev->next;
+				pthread_mutex_unlock(&llist_lock);
+				free(dev);
+				SLOG("free device is success");
+			}else{
+				syslog(LOG_ERR,"Del device is not exist");
+			}
+			break;
+		default:
+			syslog(LOG_ERR,"Not found lease sub cmd");
+			break;
+	}
+	return 0;
+}
+
+void *config_server_start(void *arg)
+{
+	socklen_t clt_addr_len;
+	int listen_fd;
+	int com_fd;
+	int ret;
+	static char data_buf[1024];
+	int len;
+	struct sockaddr_un clt_addr;
+	struct sockaddr_un srv_addr;
+	listen_fd = socket(PF_UNIX, SOCK_STREAM, 0);
+	SLOG("Start listen unix socket create");
+	if(listen_fd < 0) {
+		syslog(LOG_ERR,"cannot create communication socket");
+		return ;
+	}
+	srv_addr.sun_family = AF_UNIX;
+	strcpy(srv_addr.sun_path,ANOMALY_DOMAIN);
+	unlink(ANOMALY_DOMAIN);
+	SLOG("Start listen unix socket bind");
+	ret = bind(listen_fd, (struct sockaddr*)&srv_addr, sizeof(srv_addr));
+	if(ret == -1) {
+		syslog(LOG_ERR,"cannot bind server socket");
+		close(listen_fd);
+		unlink(ANOMALY_DOMAIN);
+		return ;
+	}
+	SLOG("Start listen unix socket listen");
+	ret = listen(listen_fd,1);
+	if(ret == -1) {
+		syslog(LOG_ERR,"cannot listen the client connect request");
+		close(listen_fd);
+		unlink(ANOMALY_DOMAIN);
+		return ;
+	}
+	SLOG("Start listen unix socket");
+	while(1) {
+		int cmd = -1;
+		//have connect request use accept
+		len = sizeof(clt_addr);
+		com_fd = accept(listen_fd,(struct sockaddr*)&clt_addr,&len);
+		if(com_fd < 0) {
+			syslog(LOG_ERR,"cannot accept client connect request");
+			close(listen_fd);
+			unlink(ANOMALY_DOMAIN);
+			break;
+		}
+		//read and printf sent client info
+		syslog(LOG_ERR,"Receive from client\n");
+		memset(data_buf, 0, 1024);
+		read(com_fd, data_buf, sizeof(data_buf));
+		syslog(LOG_ERR," Request is %d\n", data_buf[0]);
+		//Read from client
+		cmd = data_buf[0];
+		switch(cmd){
+			case LEASE_CMD:
+				deal_lease_cmd(data_buf+1);
+				break;
+			case 1:
+				break;
+			default:
+				syslog(LOG_ERR,"Not support cmd\n");
+				break;
+
+		}
+		close(com_fd);
+		/*
+		//Send to client
+		if(data_buf[0] == WRITE_TO_CLIENT) {
+			memset(data_buf, 0, 1024);
+			strcpy(data_buf, "message from server!!");
+			write(com_fd, data_buf, sizeof(data_buf));
+			syslog(LOG_ERR,"The data send to client is %s\n:",data_buf);
+		}
+		memset(data_buf, 0, 1024);
+		*/
+	}
+
+	close(listen_fd);
+	unlink(ANOMALY_DOMAIN);
+	return ;
+}
+
+void *lease_dns_block_start(void){
+	head = malloc(sizeof(LDEV));
+	if(head == NULL){
+		my_syslog(LOG_ERR,"Init lease list head fail\n");
+		return;
+	}
+	head->next = NULL;
+
+	return;
+}
diff -Nur a/src/dns_block.h b/src/dns_block.h
--- a/src/dns_block.h	1970-01-01 08:00:00.000000000 +0800
+++ b/src/dns_block.h	2018-11-27 19:09:54.290705587 +0800
@@ -0,0 +1,37 @@
+#include <pthread.h>
+#define URL_LIST
+#ifdef URL_LIST
+#include<sys/mman.h>
+#include <sys/ioctl.h>
+#define EVENT_UPDATE_LIST 25
+#endif
+int get_mac_ipv6( struct in6_addr* pipv6_src, unsigned char * pmac);
+int get_mac_by_ip(unsigned char* mac,  struct sockaddr *sa);
+int lease_dns_block(char *namebuff, void *s, char is_ipv6);
+void *lease_dns_block_start(void);
+unsigned short char_to_short(char* src);
+void short_to_char(unsigned short src, char* dst);
+struct mac_node * find_mac_node(unsigned char* mac, struct mac_node * pmac_list_hdr);
+void *config_server_start(void *arg);
+struct url_node{
+	struct url_node* pnext;
+	unsigned short str_len;
+	char* url_str;
+};
+
+struct mac_node {
+	// mac addr
+	unsigned char mac[6];
+	// 0 white list 1 black list
+	char list_type;
+	struct mac_node * pnext;
+	// url list with this mac
+	struct url_node * purl_list_hdr;
+};
+int filter_by_mac(void *sa, struct mac_node **ppmac_node, char is_ipv6);
+//#define SI_DEBUG 1
+#ifdef SI_DEBUG
+#define SLOG(X,...) syslog(LOG_ERR,X,##__VA_ARGS__)
+#else
+#define SLOG(X,...) do{}while(0)
+#endif
diff -Nur a/src/forward.c b/src/forward.c
--- a/src/forward.c	2018-11-27 18:58:27.202676753 +0800
+++ b/src/forward.c	2018-11-27 18:58:38.238677216 +0800
@@ -1088,171 +1088,6 @@
     }
 }

-#ifdef URL_LIST
-
-#ifdef HAVE_IPV6
-int get_mac_ipv6( struct in6_addr* pipv6_src, unsigned char * pmac)
-{
-    int fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
-    int status;
-//send request via netlink, the message is in req
-    struct {
-        struct nlmsghdr n;
-        struct ndmsg r;
-    } req;
-
-	char ipv6_str[INET6_ADDRSTRLEN] = {'\0'};
-	inet_ntop(AF_INET6, pipv6_src, ipv6_str, INET6_ADDRSTRLEN);
-	// my_syslog(LOG_WARNING, _("ipv6 src is: %s \n"),ipv6_str);
-    memset(&req, 0, sizeof(req));
-    // fill in the netlink message header
-    req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg));
-    req.n.nlmsg_type = RTM_GETNEIGH;
-    req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
-    // fill in the netlink message GETNEIGH
-    req.r.ndm_family = AF_INET6;
-
-    status = send(fd, &req, req.n.nlmsg_len, 0);
-    if (status < 0){
-		close(fd);
-		my_syslog(LOG_WARNING, _("rtl send failed\n"));
-		return -1;
-	}
-
-    //receive data and put it in buf
-    char buf[4096];
-    char *p;
-    struct nlmsghdr *nlp;
-    memset(buf, 0, sizeof(buf));
-    p = buf;
-    int nll = 0;
-    struct ndmsg *ndp;
-    struct rtattr *ndap;
-    int ndl;
-
-    while(1)
-    {
-            status = recv(fd, p, sizeof(buf) - nll, 0);
-            if (status < 0){
-				my_syslog(LOG_WARNING, _("receive msg failed\n"));
-				close(fd);
-				return -2;
-			}
-
-            nlp = (struct nlmsghdr *) p;
-            if(nlp->nlmsg_type == NLMSG_DONE) {
-				my_syslog(LOG_WARNING, _("get all message\n"));
-				break;
-            }
-            while(1)
-            {
-                    ndp = (struct ndmsg *) NLMSG_DATA(nlp);     // get RTNETLINK message header
-                    ndap = (struct rtattr *) RTM_RTA(ndp);      // get start of attributes
-                    ndl = RTM_PAYLOAD(nlp);
-                    while(1) {
-                        if (ndap->rta_type == NDA_DST) {
-							memset(ipv6_str, '\0', INET6_ADDRSTRLEN);
-							struct in6_addr *pipv6_get = RTA_DATA(ndap);
-							if(pipv6_get->s6_addr[0] !=  0xFF){
-								inet_ntop(AF_INET6, pipv6_get,ipv6_str, INET6_ADDRSTRLEN);
-								// my_syslog(LOG_WARNING, _("ipv6 is: %s \n"),ipv6_str);
-								if (memcmp(pipv6_get->s6_addr, pipv6_src->s6_addr, 16) == 0) {
-									ndap = RTA_NEXT(ndap, ndl);
-									memcpy(pmac,RTA_DATA(ndap),6);
-									close(fd);
-									return 2;
-								}
-							}
-							else
-							  break;
-						}
-						ndap = RTA_NEXT(ndap, ndl);
-						if (RTA_OK(ndap, ndl) != 1)
-						{
-							break;
-						}
-
-					}
-					p += status;
-					nll += status;
-					nlp = NLMSG_NEXT(nlp, nll);
-					if (NLMSG_OK(nlp, nll) != 1)
-					{
-						break;
-					}
-			}
-	}
-	close(fd);
-
-	return 0;
-}
-#endif
-
-int get_mac_by_ip(unsigned char* mac,  struct sockaddr *sa){
-	int sock_fd = 0, ret = 0;
-	struct arpreq req;
-	memset(&req, 0, sizeof(struct arpreq));
-	// set ip
-	memcpy(&req.arp_pa, sa, sizeof(struct sockaddr));
-	// set interface
-	strncpy(req.arp_dev, "br-lan", sizeof(req.arp_dev));
-	sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
-	if(sock_fd < 0)
-	{
-		my_syslog(LOG_WARNING, _("%s open socket fail.\n"), __FUNCTION__);
-		return -1;
-	}
-
-	ret = ioctl(sock_fd, SIOCGARP, &req);
-	close(sock_fd);
-	if(ret < 0)
-	{
-		my_syslog(LOG_WARNING, _("ioctl error.\n"));
-		return -1;
-	}
-	memcpy(mac, &req.arp_ha.sa_data, 6);
-	return 0;
-}
-
-int filter_by_mac(void *sa, struct mac_node **ppmac_node, char is_ipv6){
-	unsigned char mac[6] = {0};
-	struct sockaddr_in * psin;
-#ifdef HAVE_IPV6
-	if (is_ipv6){
-		if(get_mac_ipv6(sa,mac) != 2){
-			// my_syslog(LOG_WARNING, _("cannot find mac for ipv6"));
-			return -1;
-		}
-		else{
-			// my_syslog(LOG_WARNING, _("mac is %02x:%02x:%02x:%02x:%02x:%02x"), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-		}
-	}
-	else{
-#endif
-		// memcpy(&sin, sa, sizeof(sin));
-		psin = sa;
-		if(psin->sin_addr.s_addr == inet_addr("127.0.0.1"))
-		  return 0;
-		// my_syslog(LOG_ERR, _("addr:%s, port:%d\n"), inet_ntoa(psin->sin_addr), ntohs(psin->sin_port));
-
-		if(get_mac_by_ip(mac, sa) < 0){
-			// my_syslog(LOG_WARNING, _("cannot find mac for ip"));
-			return -1;
-		}
-		else{
-			// my_syslog(LOG_WARNING, _("mac is %02x:%02x:%02x:%02x:%02x:%02x"), mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-		}
-#ifdef HAVE_IPV6
-	}
-#endif
-
-	if((*ppmac_node = find_mac_node(mac, gpmac_list_hdr)) == NULL) {
-		// my_syslog(LOG_WARNING, _("get null"));
-		return -2;
-	}
-	return 0;
-}
-#endif

 void receive_query(struct listener *listen, time_t now)
 {
@@ -1543,6 +1378,16 @@
 		  }
 	  }
 #endif
+	  char lease_ret = 0;
+	  if(listen->family == AF_INET6){
+		  lease_ret = lease_dns_block(daemon->namebuff, &source_addr.in6.sin6_addr, 1);
+	  }else{
+		  lease_ret = lease_dns_block(daemon->namebuff, &source_addr.sa, 0);
+	  }
+	  if(lease_ret == 2){
+		  my_syslog(LOG_ERR, _("Lease block this request %s"),daemon->namebuff);
+		  return;
+	  }
 #ifdef HAVE_AUTH
       /* find queries for zones we're authoritative for, and answer them directly */
       if (!auth_dns)
--- a/src/dnsmasq.h	2018-11-27 19:23:25.134739615 +0800
+++ b/src/dnsmasq.h	2018-11-27 19:24:04.746741277 +0800
@@ -141,6 +141,8 @@
 #include <priv.h>
 #endif

+#include "dns_block.h"
+
 /* daemon is function in the C library.... */
 #define daemon dnsmasq_daemon

--- a/Makefile-o	2018-11-27 19:33:59.218766225 +0800
+++ b/Makefile	2018-11-27 19:32:43.598763051 +0800
@@ -73,7 +73,7 @@
        dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
        helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
        dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
-       domain.o dnssec.o blockdata.o tables.o loop.o inotify.o
+       domain.o dnssec.o blockdata.o tables.o loop.o inotify.o dns_block.o

 hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
        dns-protocol.h radv-protocol.h ip6addr.h
--- a/src/dnsmasq.h	2018-11-27 20:29:16.802905450 +0800
+++ b/src/dnsmasq.h	2018-11-27 20:29:38.202906348 +0800
@@ -1521,26 +1521,3 @@
 int inotify_check(time_t now);
 void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz);
 #endif
-
-#ifdef URL_LIST
-
-unsigned short char_to_short(char* src);
-void short_to_char(unsigned short src, char* dst);
-struct mac_node * find_mac_node(unsigned char* mac, struct mac_node * pmac_list_hdr);
-
-struct url_node{
-	struct url_node* pnext;
-	unsigned short str_len;
-	char* url_str;
-};
-
-struct mac_node {
-	// mac addr
-	unsigned char mac[6];
-	// 0 white list 1 black list
-	char list_type;
-	struct mac_node * pnext;
-	// url list with this mac
-	struct url_node * purl_list_hdr;
-};
-#endif
--- a/src/dnsmasq.h	2018-11-27 20:46:21.326948445 +0800
+++ b/src/dnsmasq.h	2018-11-27 20:47:01.406950127 +0800
@@ -16,7 +16,6 @@

 #define COPYRIGHT "Copyright (c) 2000-2015 Simon Kelley"

-#define URL_LIST
 #ifndef NO_LARGEFILE
 /* Ensure we can use files >2GB (log files may grow this big) */
 #  define _LARGEFILE_SOURCE 1
@@ -112,10 +111,6 @@
 #  include <net/ethernet.h>
 #endif
 #include <net/if_arp.h>
-#ifdef URL_LIST
-#include<sys/mman.h>
-#include <sys/ioctl.h>
-#endif
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/ip_icmp.h>
@@ -176,9 +171,6 @@
 #define EVENT_NEWROUTE  23
 #define EVENT_TIME_ERR  24

-#ifdef URL_LIST
-#define EVENT_UPDATE_LIST 25
-#endif
 /* Exit codes. */
 #define EC_GOOD        0
 #define EC_BADCONF     1
--- a/src/dnsmasq.c	2018-11-28 10:09:16.156970146 +0800
+++ b/src/dnsmasq.c	2018-11-28 10:12:46.136978958 +0800
@@ -865,6 +865,16 @@
   poll_resolv(1, 0, now);
 #endif
   init_urllist();
+	lease_dns_block_start();
+	pthread_attr_t att;
+	pthread_attr_init(&att);
+	pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED);
+	pthread_t config_server;
+	pthread_create(&config_server, &att, &config_server_start, NULL);
+	if(config_server <= 0){
+		my_syslog(LOG_WARNING,"Can not start config server !\n");
+		return -1;
+	}
   while (1)
     {
       int maxfd = -1;
