metasploit-framework

https://github.com/rapid7/metasploit-framework

Ruby

Metasploit Framework

Net::DNS::Packet#initialize

Create a new instance of Net::DNS::Packet class. Arguments are the
canonical name of the resourse, an optional type field and an optional
class field. The record type and class can be omitted; they default 
to +A+ and +IN+.

  packet = Net::DNS::Packet.new("www.example.com")
  packet = Net::DNS::Packet.new("example.com", Net::DNS::MX)
  packet = Net::DNS::Packet.new("example.com",Net::DNS::TXT,Net::DNS::CH)

This class no longer instantiate object from binary data coming from
network streams. Please use Net::DNS::Packet.new_from_data instead.

Source | Google | Stack overflow

Edit

git clone [email protected]:rapid7/metasploit-framework.git

cd metasploit-framework

open lib/net/dns/packet.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Net--DNS--Packet-initialize-for-pr


# Commit to git

git add lib/net/dns/packet.rbgit commit -m "better docs for Net::DNS::Packet#initialize"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Net--DNS--Packet-initialize-for-pr

hub pull-request


# Celebrate!