DelphiFAQ Home Search:
General :: Windows :: Network
Network setup and administration. Both from Windows and Linux angles.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Determine the DNS server address when connected through dialup

Question:

I get the DNS server address assigned by my ISP dynamically and need to (programmatically) read the DNS server addresses.

Answer:

Under Windows 2000 and newer, use the command line tool ipconfig with parameter /all:

ipconfig /all

This will return among other information all DNS server ip addresses. If you're writing code in a high-level language, span this program, redirect the output to a text file and afterwards read the lines preceeded by the keyword DNS-Server. (Valid for XP, the actual keyword may be different in other Windows versions.)

Under Windows 95 and Windows 98 there is no tool ipconfig. Instead you can use WinIPcfg (which is a graphical tool; cannot be read from your own application if that was desired.)

Under Linux the command is ifconfig.

Generated 0:02:50 on May 26, 2017