• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use command host

 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I should create a script name iphost.sh .This script will take as appointed one address ip and when i call the command host will appear the hostname which corresponds to an IP.Lets say IP is host 002.222.111.000 appear 000.111.222.002 in-addr.arpa domain name pointer name.server.com (name.server.com i put it because i dont want to give the original server).From all this i should keep only the bold name that finds in the end (name.server.com ) .When i give command host 111.333.444.444 doesnt exist Host 111.333.444.444 .in-addr.arpa not found: 3(NXDOMAIN).Script should know if "not found" in this case will print one (- )
example

i did this but i dont know what to use next with this
:vi iphost.sh
echo -n 002.222.111.000
escape +wq!
sh iphost.sh
 
reply
    Bookmark Topic Watch Topic
  • New Topic