Giter VIP home page Giter VIP logo

cdn_detector's Introduction

cdn_detector

An efficient distributed CDN domain name detector

一、代码介绍

  1. dns_query:负责爬取dns解析记录并提供访问API接口

    • clawer_domains.py:爬取指定域名下的所有子域名列表
    • query.py: 爬取给定DNS递归服务器指定域名的DNS解析路径,支持一次查询一个递归服务器,也支持一次查询多个递归服务器
    • web_server.py:提供一个web形式的API,方便中心节点向子节点下发任务
      • 接口名:/query
      • 参数1:待查域名
      • 参数2:递归服务器ip列表
  2. database: 定义mysql数据库表已经数据库查询插入等操作

    • database.py: 定义存储A记录的关系表A和存储CNAME记录的CNAME表

    • database_op.py: 以对象/关系映射(ORM)形式封装数据库,以面向对象的形式操作数据库。

      • is_exist(), 判断域名是在数据库中;

      • op_add(), 添加CNAME记录/A记录,以字典的形式传入;

      • op_select(), 查找某个域名,返回与之相关的系列CNAME域名(如果CNAME解析的IP个数大于等于某个阈值,如2)。

    • search_neo4j.py:从图数据库neo4j中取出某个域名到所有的IP的完整路径,并格式化为两个字典列表格式,用于前端渲染

  3. test: 使用locust压力测试工具进行压力测试

    • pressure_test.py: 压力测试类
  4. utils: 提供配置和一些常用工具函数

    • config:定义了数据库配置信息,DNS递归服务器信息,子节点信息等
  5. back_end: 使用django实现的主节点web服务

  6. dns_manage: 核心框架:Vue

二、部署

2.1 环境搭建

主节点在

  1. python环境:提供requirements.txt文件

    pip install -r requirements.txt
  2. 数据库环境:

    • mysql
    • neo4j

2.2 部署

在utils/config中配置好mysql和各个节点的信息

  1. dns解析记录子节点部署

    cd dns_query
    python web_server.py
  2. 部署主节点

    cd back_end
    python Server_communication.py
  3. 部署web服务

    cd back_end
    python manage.py runserver

cdn_detector's People

Contributors

sunhanwu avatar suneternal avatar lizhiping1997 avatar

Stargazers

johnd0e avatar Xu Hong Bo avatar  avatar

Watchers

James Cloos avatar A-new avatar  avatar

Forkers

mereybkx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.