i would like to how a host name is stored and it's structure in dns (domain name service) along with ipaddress.by which name a normal client computer is given it's hostname in the dns. here the client availing particular host name does not pay for it.

in my computer i have typed "hostname" in cmd. i got my some name. is this is the string that is stored in the dns?


.......... thanks inadvance

Your question is very confusing. Here is an example of how to set up a Socket, which is one end of a connection/pipeline to send stuff back and forth, basically. If you want the client to be on your own computer, then it would be 'localhost'. Otherwise, the String hostname would be set to the web address of wherever.


int port = 1235;
String hostname = "localhost";
Socket connectionSock = new Socket(hostname, port);
out = new ObjectOutputStream(connectionSock.getOutputStream());
in = new ObjectInputStream(connectionSock.getInputStream());


Also, google 'Java Socket' and 'Java ServerSocket'

Your question is very confusing. Here is an example of how to set up a Socket, which is one end of a connection/pipeline to send stuff back and forth, basically. If you want the client to be on your own computer, then it would be 'localhost'. Otherwise, the String hostname would be set to the web address of wherever.


int port = 1235;
String hostname = "localhost";
Socket connectionSock = new Socket(hostname, port);
out = new ObjectOutputStream(connectionSock.getOutputStream());
in = new ObjectInputStream(connectionSock.getInputStream());


Also, google 'Java Socket' and 'Java ServerSocket'

basing on which name our computer hostname is made in "domain name system"?
example: suppose my computer administrator account name is "hunter".does this is carried in the domain name system. so that if i send request to the domain name system with name
"hunter" by using java method getByName("hunter") and i get ipaddress attached with this hostname(hunter).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.