/build/static/layout/Breadcrumb_cap_w.png

DNS Entries

Hi,

Is it possible to pull a report that will give me the DNS entries on all my comters?

Thx

0 Comments   [ + ] Show comments

Answers (22)

Posted by: scottlutz 13 years ago
Orange Senior Belt
0
I don't think that, by default, we collect the fully qualified domain name of each client, but what you could do is use a Custom Inventory rule to collect the data and then report on the specific Inventory item.
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Are you wanting the DNS servers that the PCs are pointing to?

This could also be done with a custom inventory rule. Something more refined like
http://www.kace.com/support/kb/index.php?action=artikel&cat=5&id=968&artlang=en or something quick and dirty like
ShellCommandTextReturn(ipconfig -all | find /I "DNS Server")

Both could be reported on but the more refined it is the less work you have to do in a report to consume it. The unrefined approach is fine for a quick look at a specific machine.
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
That is exactly want I want.

If I add this inventory rule, how will I get the data then? Must I run a report against this rule to get the DNS settings of a specific client?
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
The data will be gathered when the machine does an inventory. Here is what I just did as a quick test: WScript.StdOut.Write " DNS servers in search order:"

If Not IsNull(objAdapter.DNSServerSearchOrder) Then
For i = 0 To UBound(objAdapter.DNSServerSearchOrder)
Wscript.StdOut.Write " " & objAdapter.DNSServerSearchOrder(i)
Next
End If
WScript.Echo
  • Saved script as c:\scripts\ipconfig.vbs
  • Then i created a custom software inventory item (targeted to windows) called "ipconfig" that have following rule:
ShellCommandTextReturn(cscript.exe c:\scripts\ipconfig.vbs)
  • Then I forced an inventory (runkbot -s 4 0) for my 5.3 agent
  • Then in inventory I had a bunch of data.
  • The report I ran was:
select M.NAME,TRIM(SUBSTRING_INDEX(
SUBSTRING_INDEX(SUBSTRING_INDEX(STR_FIELD_VALUE,CONCAT(M.IP,'<br/>'),-1),'<br/> DNS domain: lan<br/>',1)
,'DNS servers in search order:',-1)) CURRENTDNSLIST

from MACHINE M JOIN MACHINE_SOFTWARE_JT MS ON MS.MACHINE_ID=M.ID
JOIN SOFTWARE S ON S.ID=MS.SOFTWARE_ID
JOIN MACHINE_CUSTOM_INVENTORY CI ON CI.ID=M.ID and CI.SOFTWARE_ID=S.ID
WHERE
S.DISPLAY_NAME ='ipconfig';


Basically that query will use the current machine's IP address and get the DNS information from the scripts output for the matching adapter. It does some string manipulation to get it down to one line.
  • For other machines I plan to push out c:\scripts\ipconfig.vbs as a file synchronization for whichever machines I want to have it.
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
I created the vbs script and saved it under c:\scripts\ipconfig.vbs

I run this script from the command line like this c:\windows\system32\cscript.exe c:\scripts\ipconfig.vbs

I get the following error when running this "DNS servers in serch order:c:\scripts\ipconfig.vbs<3,2> Microsoft VBScript runtime error: Object required: "objAdapter"
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Did you grab the whole vbs from the link I provided? The snippet I gave was just my modifications to the script, not the entire script
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
Ok I got the script to work properly now. Just to confirm. I need to run this .vbs script on all the clients and then I can run the report to get the result?
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Every step from this post http://itninja.com/question/outlook-profile473&mpage=1&key=&#

For the force inventory -- do not force inventory on all machines. For most machines simply wait for them to check in and the data will be there after that.
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
I did create the inventory rule.
I did create the .vbs script and executed it on a pc.
Forced inventory on this pc
Created the SQL report

When I go to my software tab on the kbox and I go to the inventory rule I can see the pc that I forced is there, but when I run the report it doesnt show me any details. It is blank.
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
The report look like this when open it in a csv format:


Title: DNS Entries 2
Description:
Category: Marius
Server Hostname: kbox.jdg.co.za
Generated: 2011/11/29 13:48

# Name Currentdnslist
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
In the inventory detail of that PC is there a custom inventory section? If so is the IP data there?
What version of the agent you running?
What OS is it running on?
What server version?
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
This is what I get under the custom inventory section:

3) DNS Entries: Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.


Network Adapter 1
=================
Description: Broadcom 440x 10/100 Integrated Controller
Physical (MAC) address: 00:1A:A0:11:DB:E7
Host name: 5WKHYC1
IP address: 11.208.9.102
Subnet: 255.255.255.0
Default gateway: 11.208.9.253

DNS
---
DNS servers in search order:
11.2.10.56
11.1.1.11
DNS domain:
DNS suffix search list: jdg.co.za

DHCP
----
DHCP enabled: False
DHCP server:
DHCP lease obtained:
DHCP lease expires:

WINS
----
Primary WINS server:
Secondary WINS server:

[string]


It is on a XP machine and have client 5.3.47657
Our KBOC is on version 5.3.47927
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Ok, getting there....
The query is not working because you did not modify the script with my changes to get the servers on one line.

After my modifications that section will look like:
DNS servers in search order: 11.2.10.56 11.1.1.11
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
Can you please give me the script with everything in it. With your modification included?
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Here is the script:

Attachment

Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
Ok I made the change and it looklike this :

DNS Entries: Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.


Network Adapter 1
=================
Description: Broadcom 440x 10/100 Integrated Controller
Physical (MAC) address: 00:1A:A0:11:DB:E7
Host name: 5WKHYC1
IP address: 11.208.9.102
Subnet: 255.255.255.0
Default gateway: 11.208.9.253

DNS
---
DNS servers in search order: 11.2.10.56 11.1.1.11
DNS domain:
DNS suffix search list: jdg.co.za

DHCP
----
DHCP enabled: False
DHCP server:
DHCP lease obtained:
DHCP lease expires:

WINS
----
Primary WINS server:
Secondary WINS server:

[string]

The report still is blank though?
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
ORIGINAL: GillySpyThen i created a custom software inventory item (targeted to windows) called "ipconfig" that have following rule:

You called your software item "DNS Entries" instead of "ipconfig". You can change the report SQL or the software item name, but they have to match
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
THANKS it is working perfect. I really appreciate your efforts and patience with me.

Just another question on a different note:

If I have a directory with 400 different files in it will it be possible to create a report that will tell me which pc's have these 400 files installed and also what there modified dates are?
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Yes you could use the same principles here to list those files in inventory. Once in inventory then reporting on it isn't so bad. I would open up a new thread so more eyes will the new question.
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
Once again THANKS.

Will you keep me updated with the new thread?
Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Please open a new thread for it. I'll contribute as I can.
Posted by: Mariusja 13 years ago
Second Degree Green Belt
0
Ok will do.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ