How to stop other domain name point to your IP?

Discussion in 'Security' started by TopViet, Mar 26, 2009.

  1. #1
    It come to my attention that some domains point their host to my IP. For example, if someone type www.example-their-domain.net, it redirect to my IP: 255.255.255.255 which is address of my web.
     
    TopViet, Mar 26, 2009 IP
  2. justdoit1

    justdoit1 Peon

    Messages:
    100
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    justdoit1, Mar 26, 2009 IP
  3. TopViet

    TopViet Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Good ideas. Thanks justdoit1. BTW, would you explain more why "It might be creating DDOS attack to my IP"? TIA
     
    TopViet, Mar 26, 2009 IP
  4. baonhi41

    baonhi41 Peon

    Messages:
    141
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Nobody can POINT his domain to your IP if you don't add that domain to your server, only redirect to your IP.
    Ma hinh nhu ku topviet la nguoi Vietnam a :D
     
    baonhi41, Mar 27, 2009 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    People can point their DNS at your server which there is no way of stopping. If a person tries to go to the domain, the request will be sent to your server which can use resources.

    To prevent any DNS poisoning or unintentional DOS effect, you should make sure you server will not respond to DNS inquiries where the site being requested is not on your server.
     
    jestep, Mar 27, 2009 IP
  6. Serghei

    Serghei Well-Known Member

    Messages:
    1,062
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #6
    try and set up .htaccess so that the URL in any calls to www.otherdomain.com get replaced with www.yourdomain.com. i'm useless with .htaccess (i set it up then forget what i've done and how it works) so hopefully someone can post some code for it.

    I Need this code now too, help us please with this code
     
    Serghei, Apr 30, 2009 IP
  7. pitagora

    pitagora Peon

    Messages:
    247
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #7
    you do know 255.255.255.255 is a broadcast address right? It's not your ip :p
     
    pitagora, May 1, 2009 IP
  8. yah0m

    yah0m Peon

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    How do you go about doing that?
     
    yah0m, May 11, 2009 IP
  9. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #9
    If you're using bind as your dns server, you can put:

    recursion no;

    in your named.conf file.

    Do a search for "preventing recursive DNS" and the type of server you are using.
     
    jestep, May 12, 2009 IP
  10. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #10
    There is absolutely nothing you can do about people pointing their DNS at your IP address because it is their DNS. You can do something once a visitor reaches your site using someone else's DNS.

    The good news is that it doesn't do very much harm. The worst thing they can do is direct people to your website with their domain name in the URL bar. You can easily redirect visitors to the correct domain by putting this in your .htaccess file or in your httpd.conf file:

    
      RewriteCond %{HTTP_HOST} !^www.your-domain.com$
      RewriteRule ^/?(.*) http://www.your-domain.com/$1 [QSA,R=301,L]
    
    Code (markup):
    As an example in real life, check the IP address of x10.dejanews.com by typing
    nslookup x10.dejanews.com
    Code (markup):
    on the commmand line.
    Then type
    nslookup google.com
    Code (markup):
    on the command line.
    Notice that they have the same IP address ?

    DejaNews are pointing one of their subdomains at Google's IP address. I don't know why... it's weird. But lots of people do it.

    Lastly, type x10.dejanews.com into your browser and see what happens. If you have the LiveHTTPHeaders plugin for Firefox you will be able to see that Google sends back a 302 response to redirect you to http://groups.google.com. If you don't, you will just see that you end up on groups.google.com

    The code I gave you above will do exactly the same as what Google are doing but it will use a 301 redirect instead. You can make it use a 302 by removing the "=301" or by changing the 301 to a 302.
     
    Ladadadada, May 16, 2009 IP
  11. Serghei

    Serghei Well-Known Member

    Messages:
    1,062
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #11
    thanx it help me so much, but i have another question!

    i have 3 websites on my dedicated IP, when i add the code you give me, all my 3 websites redirect to the first one.

    I have shared hosting on GoDaddy, and dedicated IP, each domain in different folder.

    How i can make that each website redirect correct?
     
    Last edited: Aug 12, 2009
    Serghei, Aug 12, 2009 IP