inetaddress Questions
7
Solved
I am trying to convert strings into Inetaddress. I am not trying to resolve hostnames: the strings are ipv4 addresses. Does InetAddress.getByName(String host) work? Or do I have to manually parse i...
Manion asked 22/2, 2010 at 5:42
4
I am messing around with DNS services in Java. I am specifically trying to look up all google.com addresses and display them in an array, similar to running a lookup using nslookup:
nslookup -q=TXT...
Regeneration asked 17/2, 2015 at 10:44
12
Solved
InetAddress byName = InetAddress.getByName("173.39.161.140");
System.out.println(byName);
System.out.println(byName.isReachable(1000));
Why does isReachable return false? I can ping the ...
Reply asked 29/3, 2012 at 9:24
10
Solved
I have an int which contains an IP address in network byte order, which I would like to convert to an InetAddress object. I see that there is an InetAddress constructor that takes a byte[], is it n...
Unmitigated asked 24/12, 2009 at 9:59
3
I am trying to obtain the FQDN of a windows machine in my domain, using Java code.
I have tried the InetAddress.getByName("machine-1").getCanonicalHostName() but only returns the machine name.
On...
Chaliapin asked 1/9, 2011 at 11:12
3
Solved
I'm running my application on Windows Server 2008 on an Intranet.
To login the application tries to get the hostname from the request to validate the user.
However, sometimes the application retur...
Negative asked 8/11, 2013 at 15:28
1
Solved
Regarding this link where using the codes provided to produce the IP addresses.
String ip;
try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while...
Maritzamariupol asked 1/12, 2016 at 13:52
2
Solved
I can able to fetch all device ip addresses in Local Area Network with inetaddress class. What I need to do is reverse lookup ip-address and find as device name in network like : "Jimmie's Macbook"...
Deerdre asked 21/9, 2016 at 8:43
2
InetAddress.getLocalHost().getHostName() is no more getting the name of the HostName since I switched to java 8 ...
with the jdk1.8 the InetAddress.getLocalHost().getHostName() returns "localhost"...
Superdreadnought asked 27/7, 2016 at 20:29
3
I have a question about Guava's InetAddress.coerceToInteger method.
According to docs the method:
public static int coerceToInteger(InetAddress ip)
'Returns an integer representing an IPv4 addre...
Bunce asked 10/1, 2013 at 13:6
0
I need to get the details of all wireless devices that are connected to my wifi network. I'm getting IP, MAC addresses, somehow Vendors of device as well.
How do I get the device type? (i.e lapto...
Immoderation asked 12/4, 2016 at 8:33
1
Solved
I wrote the following code to get the IPv4 address of the eth0 interface I am using on a machine. However the code only finds fe80:x:x:x:xxx:xxxx:xxxx:xxxx which is not returned since I am looking ...
Piotr asked 26/6, 2015 at 18:50
1
Solved
I am using python 2.6.6 and I am not allowed to change it. I have a sorted list of IPv4 addresses. I need to find the smallest network that covers all the ip addresses in the list. The smallest net...
Squalid asked 11/12, 2014 at 16:54
3
I have the following little code snippet:
InetAddress address = InetAddress.getByName(host);
if(address.isReachable(TIMEOUT_IN_MILLISECONDS)) {
System.out.println(host + " is reachable.");
Str...
Chlamys asked 2/5, 2012 at 19:25
4
Solved
I am using python-netaddr library to work on IP Addresses and subnets. I read the full documentaion of netaddrd given: Netaddr documentation. But didn't found any solution to my problem. I have a I...
Karajan asked 30/5, 2012 at 9:24
1
In which line the DNS lookup occurs?
import java.net.InetAddress;
import java.net.UnknownHostException;
public class Addresses {
public static void main(String[] args) {
try {
InetAddress addr...
Receive asked 10/4, 2014 at 3:22
1
I have the following problem: I create an ArrayList and I put in this arraylist all the IP addresses of my client (one if the client have a single network card, n if the client run on a PC having n...
Calamity asked 3/12, 2013 at 14:11
2
Solved
My work is developing software for network capable cameras for retail enviroments. One of the peices of software my team is developing is a webserver that retrieves various reports generated in HTM...
Carbuncle asked 26/9, 2013 at 22:16
2
I currently am trying to create a chat server as an assignment and want each message to contain a header. It will contain ipv4 address followed by a letter then a username
I can easily decode stri...
Distilled asked 15/9, 2013 at 0:17
3
Solved
I'm don't understand, why code below prints 0.0.9.229 instead 127.0.0.1. Can anybody tell me, hot to fix that?
String ha = InetAddress.getLocalHost().getHostAddress();
System.out.println(ha);
UP...
Ball asked 28/8, 2013 at 13:6
2
Solved
In my android device I am trying to find its IP address(IPV4).
If I do the following code
InetAddress inet = InetAddress.getLocalHost();
System.out.println(inet.getHostAddress()); //giving me 127...
Hygrometer asked 22/6, 2013 at 14:53
1
Solved
If I have a String representing an IP address (IPv4 or IPv6) how can I create a ServerSocket and bind to this IP without caring if the IP passed in, is IPv4 or IPv6?
I see that there is a construct...
Arturoartus asked 20/2, 2013 at 9:54
1
I am using InetAddress to determine if my server is online.
If the server is offline it will restart the server.
This process loops every 5 minutes to check once again if the server is online.
I...
Roommate asked 16/2, 2013 at 1:30
1
Solved
Can anyone please explain me the difference between Host Name and Canonical Host Name?
I am currently using InetAddress class to fetch host name using the IP Address. I came across these 2 APIs.
S...
Artificial asked 1/10, 2012 at 7:29
1
Solved
I am trying to find out if specific hosts on my network are reachable.
My java code is as follows:
InetAddress adr = InetAddress.getByName(host);
if(adr.isReachable(3000)){
System.out.println(hos...
Comose asked 4/3, 2012 at 14:12
1 Next >
© 2022 - 2024 — McMap. All rights reserved.