Results 1 to 7 of 7

Thread: Redirect all DNS queries to IP

  1. #1
    turko123
    Guest

    Default Redirect all DNS queries to IP

    Hi,

    If anyone could help me I would be greatly appreciative.
    This is what I am trying to do...

    I have created a wireless AP in backtrack 3 using airbase. I have setup dhcpd etc so that clients can connect. What I would like to happen now is that when a client types in a url they are redirected to 10.0.0.1. I have messed around with iptables and natd and managed to get all other ips typed into the address bar redirected to 10.0.0.1. I'm guessing there needs to be access to a dns server so that an IP can be resolved, the computer does not have access to the internet so will I need to install and configure my own local dns server or is there just a quick way of redirecting all dns queries to 10.0.0.1.

    Let me know how I could set this up.
    Thanks.

  2. #2
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    One really simple method:

    You already have a DHCP server set up, right? Well your DHCP server should be telling the local computers what DNS server to use. So change the settings of the DHCP server so that they specify your own IP address as the DNS server.
    Then you just set up a DNS daemon on your computer. All DNS requests will go directly to your computer, and you can respond to these requests with any IP address you like.

    There's countless ways of going about this, but I don't know what your end objective is.
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  3. #3
    Super Moderator lupin's Avatar
    Join Date
    Jan 2010
    Posts
    2,943

    Default

    I have done this before using dnsmasq as a DNS server. There is a simple configuration line that you set to have all resolution requests resolved to a single IP. Its been a year or so since I have done this, but I found the correct line by reading the man page and the example config file, so if you start there you should be able to work it out.
    Capitalisation is important. It's the difference between "Helping your brother Jack off a horse" and "Helping your brother jack off a horse".

    The Forum Rules, Forum FAQ and the BackTrack Wiki... learn them, love them, live them.

  4. #4
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    Quote Originally Posted by lupin View Post
    I have done this before using dnsmasq as a DNS server.
    Dnsmasq doesn't come with BT4 Pre-Final, I had to "apt-get" it just there.

    I think it should be added to the LiveCD image so that you can play around with this stuff on a LiveCD... maybe you could pass the message on to the distro-put-together people
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  5. #5
    Good friend of the forums
    Join Date
    Jun 2008
    Posts
    425

    Default

    @op
    You could all so have a look at prioxy(web proxy), it more just on web stuff but rediection of certain links in a web page, say some one was trying to download a file, you can replace it with yours or a page etc..

  6. #6
    turko123
    Guest

    Default

    Thanks for all the replies I will do some research into dnsmasq when I have some time later. If anyone remembers the command to use please let me know.
    Thanks again.

  7. #7
    turko123
    Guest

    Default

    Got it working.
    Here are the commands:

    modprobe tun
    airbase-ng -c 10 --essid "wireless" wlan0

    ifconfig at0 up 10.0.0.1 netmask 255.255.255.0
    echo > /var/state/dhcp/dhcpd.leases
    dhcpd -cf /etc/dhcpd.conf
    dnsspoof -i at0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •