How do I run a nslookup command?
I want to run a nslookup command from my C# app, but the command says I need to be in a certain folder, so from my C# code?
Is there an easy way to run a nslookup from my app. For instance, if I open notepad, and type in: nslookup google.com then click ok and close it, then in my program, I will do something like: but how would I do that from a program? Thanks in advance. Use shellExecute: Example of usage: var path = @"C:Program FilesMyProgram";. System.Diagnostics.Process.exe", @"/cnslookup google.
How do I get the IP address from nslookup?
I'm working on a program and I need the IP address of an IP.
I've tried some different ways but nothing works.
Import socket. S = socket.socket() s.connect(('www.google.com', 80))
While True: s.sendall(b'GET / HTTP/1.1r
Host: www.comr response = s.close() And I want the IP address of www.com You should use python sockets to interact with a server. Your problem is that you are sending all your GET requests to a single server.
In the following code you create a listener and use this to connect to multiple servers (websites). Import webbrowser. Import time. Mylistener = socket.socket(socket.AFINET, socket.SOCKSTREAM)
Mylistener.bind(('0.0)0', 8000)) # listen on all interfaces for connections
Mylistener.listen(5) c, addr = mylistener.accept() print(' connected from '.recv(1024) # now handle your connection. # use "while True" instead of "while" and remove the print in the if/else statement. while True: # if "myreader" is None: # break. if myreader: mywriter.write(myreader.decode())
Related Answers
How do I get nslookup on Linux?
Nslookup has a slew of different query modes that you can us...
What is the Linux version of nslookup?
Nslookup. nslookup is a command-line tool for querying the n...
How to install nslookup command in CentOS 7?
I mean to check the hostname, ip address. k1l...