Very simple DNS server

后端 未结 4 1389
眼角桃花
眼角桃花 2021-02-08 15:35

I have a linux server has an ad-hoc wireless network for clients to connect to. Once connected I want users to always be redirected to it\'s own web server no matter what URL th

相关标签:
4条回答
  • 2021-02-08 16:20

    I would suggest using dnsmasq. It's more full-featured than you absolutely need, but it's very well-written, small, and easy to install, and the only configuration you would need to give it is --address='/#/1.2.3.4' to tell it to answer all queries (that don't match some other rule) with the address 1.2.3.4. dnsmasq is well-known and maintained and probably a more robust server than Net::DNS::Nameserver.

    0 讨论(0)
  • 2021-02-08 16:29

    As I answered in the other related question, I wrote a basic DNS server in C++ for a job interview under BSD license.

    I think the code was pretty clean, though I didn't made unit tests :-( I tested it with dig, and it took about a week understanding DNS protocol + implementing + documentation.

    If anyone would want to extend it, I guess it would not be very difficult. Because I think it only supported inverse queries, as that was asked in the exercise.

    The code could be found here: http://code.google.com/p/dns-server/

    It was migrated to: https://github.com/tomasorti/dns-server

    0 讨论(0)
  • 2021-02-08 16:32

    I've used fakedns.py when reversing malware. It may be too limited for your situation.

    0 讨论(0)
  • 2021-02-08 16:42

    Use Net::DNS::Nameserver and write your own reply handler.

    For C, look at:

    • How to Build a custom simple DNS server in C/C++
    • Create custom DNS name server in C
    0 讨论(0)
提交回复
热议问题