Capture Primary Secondary DNS Server IPs

(imported comment written by MrFixit)

I’m not very good with regex but you can use something like the following and only select the part you want to report.

The way the example is written it will work with 3 or more DNS servers, but will only report give values for the first 3. Perhaps someone that is good with regex can provide an expression that will repeat 1 to many.

parenthesized parts (1;2;3) of matches (regex "^(

http://0-9.

+);(

http://0-9.

+);(

http://0-9.

+)") of (concatenation “;” of (addresses of dns servers of adapters of network as string))

To just get the second value:

parenthesized part 2 of matches (regex "^(

http://0-9.

+);(

http://0-9.

+);(

http://0-9.

+)") of (concatenation “;” of (addresses of dns servers of adapters of network as string))

You can also throw and exists on the front and use it to test to see if there is a value.

exists parenthesized part 2 of matches (regex "^(

http://0-9.

+);(

http://0-9.

+);(

http://0-9.

+)") of (concatenation “;” of (addresses of dns servers of adapters of network as string))