Code:
$ truss -o /tmp/nsl.tr nslookup 12.23.34.45 ; grep write /tmp/nsl.tr
Using /etc/hosts on: hideme
looking up FILES
Trying DNS
Trying NIS
*** No hostname information is available for "12.23.34.45"
write(1, "U s i n g / e t c / h o s t s ".., 32) ....... = 32
write(1, "l o o k i n g u p F I L E S ".., 17) ....... = 17
write(1, "T r y i n g D N S \n", 11) ................... = 11
write(1, "T r y i n g N I S \n", 11) ................... = 11
write(2, "* * * N o h ", 8) .......................... = 8
write(2, "o s t n a m e ", 7) ............................ = 7
write(2, " i n f o r m a ", 8) .......................... = 8
write(2, "t ", 1) ........................................ = 1
write(2, "i o n i s a ", 8) .......................... = 8
write(2, "v ", 1) ........................................ = 1
write(2, "a i l a b l e ", 8) .......................... = 8
write(2, "f ", 1) ........................................ = 1
write(2, "o r " 1 2 . 2 ", 8) .......................... = 8
write(2, "3 . 3 4 . 4 5 ", 7) ............................ = 7
write(2, "" \n", 2) ...................................... = 2
$
Good IP:
$ truss -o /tmp/nsl.tr nslookup 89.67.45.123 ; grep write /tmp/nsl.tr
Using /etc/hosts on: hideme
looking up FILES
Name: hideme
Address: 89.67.45.123
Aliases: hideme.somedomain.com
write(1, "U s i n g / e t c / h o s t s ".., 32) ....... = 32
write(1, "l o o k i n g u p F I L E S ".., 17) ....... = 17
write(1, "N a m e : h i d e m e \n".., 26) ....... = 26
write(1, " 8 9 . 6 7 . 4 5 . 1 2 3 ".., 26) ....... = 26
write(1, " h i d e m e . s o m e d o ".., 34) ....... = 34
$
Good IP, PTR specific query for pointer-reverse = ip to name:
$ truss -o /tmp/nsl.tr nslookup -q=PTR 89.67.45.123 ; grep write /tmp/nsl.tr
Using /etc/hosts on: hideme
looking up FILES
Trying DNS
123.45.67.89.in-addr.arpa name = hideme.somedomain.com
write(1, "U s i n g / e t c / h o s t s ".., 32) ....... = 32
write(1, "l o o k i n g u p F I L E S ".., 17) ....... = 17
write(1, "T r y i n g D N S \n", 11) ................... = 11
write(1, "1 2 3 . 4 5 . 6 7 . 8 9 . i n - ".., 28) ....... = 28
write(1, "\tn a m e = h i d e m e . s ".., 34) ....... = 34
write(1, "\n", 1) ........................................ = 1
$
Good IP, specific DNS server:
$ truss -o /tmp/nsl.tr nslookup 89.67.45.123 89.123.45.67 ; grep write /tmp/nsl.tr
Name Server: nameserver1.somedomain.com
Address: 89.123.45.67
Trying DNS
Name: hideme.somedomain.com
Address: 89.67.45.123
write(1, "N a m e S e r v e r : n a ".., 50) ....... = 50
write(1, " 8 9 . 1 2 3 . 4 5 . 6 7 \n".., 17) ....... = 17
write(1, "T r y i n g D N S \n", 11) ................... = 11
write(1, "N a m e : h i d e m e ".., 44) ....... = 44
write(1, " 8 9 . 6 7 . 4 5 . 1 2 3 ".., 19) ....... = 19
$