-3

I am sending a mail in java by using mail.jar. In that I am giving a URL to perform some action.

In the URL I am giving the actual IP Address. But I found that giving IP address is not secure.

So I want to generate subnet mask or something like that to secure the IP Address.

So Please help me to generate subnet mask for IP Address in Java.

Thank You

Deepu
  • 2,590
  • 19
  • 52
  • 74

1 Answers1

0

You cannot compute the subnet mask from the IP address. You can guess, but that guess may be wrong. I don't see how a subnet mask would “secure” an address in any way, or how an IP address would be less secure than a host name. What kind of security do you have in mind here?

So for the question as it currently reads, the answer is:
That's impossible, but why should you want to do that anyway?

MvG
  • 57,380
  • 22
  • 148
  • 276
  • Thanks MvG for your reply. I mean to secure IP Address in the way instead of giving IP number like '123.456.789.000' we should give like 'demo.example.com' – Deepu Jul 20 '12 at 12:11
  • 1
    So it is not a *netmask* which you are looking for, but a *host name* instead. The task you try to accomplish here is usually called *reverse DNS*, and ways to address it in Java have already been [discussed here](http://stackoverflow.com/a/7097849/1468366). If there is a specific question you want to ask about reverse DNS, I suggest you do so in a new question, instead of editing this one here, as this is not an interactive chat site here. – MvG Jul 20 '12 at 12:17
  • Ok sorry I asked it in reverse, bcoz I dont hv much knowledge of Networking. I'll try with your link – Deepu Jul 20 '12 at 12:19