I realize this is not the proper forum for scripts but this does what he ask.
Code:
  [color:blue] ON ^*:DNS: {
  set %dns.IP $iaddress
  echo 1 -a Start 3DNS
  echo 1 -a Nick: 4 $nick
  echo 1 -a IP: 2 * $iaddress *
  echo 1 -a Host: 12 $naddress
  echo 1 -a ENd
  halt
} [/color]