Git Product home page Git Product logo

jdns's Introduction

JDNS

JDNS is a Java DNS library that allows you to host a DNS Server and make DNS Requests.

Why JDNS

InetAddress is great because it will auto get the IP address from any hostname, however this isnt always a great option when it comes to security. This is because it will make requests to your DNS server posibbly bypassing SOCKS proxies. This project will allow you to make requests to specific servers not what is defined by the host and potentially over SOCKS5.

Supported Records

I have not been able to test every record type, so some may function but I'm uncertain.

TYPE Value
A Working
AAAA Working
NS Working
CNAME Working
SOA Working
PTR Working
MX Working
TXT Working
SRV Untested
CAA Untested

Note

IQUERY (Inverse Query) is depricated in RFC-1035 and theirfore not implemented in this project

Usage

To start the DNS server this is the usage:

DnsServer server = new DnsServer();
//IF THE DOMAIN IS NOT IN OUR RECORDS USE THIS DNS SERVER
server.addServer(new InetSocketAddress(InetAddress.getByName("1.1.1.1"), 53));
//FALLBACK DNS SERVER - YOU CAN ADD AS MANY AS YOU WANT
server.addServer(new InetSocketAddress(InetAddress.getByName("1.0.1.0"), 53));
server.start(53);

//TO ADD RECORD
server.getRecordStore().add(new ARecord("google.com", DnsClass.IN, 300, InetAddress.getByName("127.0.0.1")));

To send a request you can do this:

server.send(request, new ResponseCallback(){
    @Override
    public void onResponse(ResponseEvent event){
        MessageBase response = event.getMessage();
    }
});

jdns's People

Contributors

drbrad avatar

Stargazers

 avatar

Watchers

 avatar

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.