-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

3
  • An example of what you have and what you're after would help. Commented Jul 20, 2012 at 10:50
  • I have IP Address 123.456.789.111, so I am expecting something like demo.example.com for my IP Address Commented Jul 20, 2012 at 12:17
  • 123.456.789.111 lol Commented Dec 1, 2017 at 15:03

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

3 Comments

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'
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. 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.
Ok sorry I asked it in reverse, bcoz I dont hv much knowledge of Networking. I'll try with your link

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.