Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding hosts file support #108

Merged
merged 1 commit into from
Nov 8, 2021
Merged

Adding hosts file support #108

merged 1 commit into from
Nov 8, 2021

Conversation

Mzack9999
Copy link
Member

No description provided.

@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Sep 27, 2021
@Mzack9999 Mzack9999 self-assigned this Sep 27, 2021
@Mzack9999 Mzack9999 linked an issue Oct 11, 2021 that may be closed by this pull request
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ git branch

  98-feature-custom-port-in-resolvers
* adding-hosts-file-support
  dev
  master

$ go build

$ cat /etc/hosts

# End of section
10.10.11.105 horizontall.htb
10.10.11.105 api-prod.horizontall.htb

$ echo horizontall.htb | ./dnsx -resp -hostsfile -verbose

      _             __  __
   __| | _ __   ___ \ \/ /
  / _' || '_ \ / __| \  / 
 | (_| || | | |\__ \ /  \ 
  \__,_||_| |_||___//_/\_\ v1.0.6

		projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.

@ehsandeep ehsandeep added the Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. label Nov 1, 2021
@Mzack9999
Copy link
Member Author

@ehsandeep the domain is not shown as the resolver returns nxdomain (hosts file data is added to the resolver result):

$ echo horizontall.htb | go run . -resp -hostsfile -verbose -rcode 0,3
horizontall.htb [NXDOMAIN]

Not sure if all status codes should be enabled when parsing hosts file (as above) or successful lookup should be returned for A/AAAA queries having hardcoded records in the hosts file without querying the DNS server.

@ehsandeep ehsandeep removed the Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. label Nov 8, 2021
@ehsandeep ehsandeep merged commit 1450448 into dev Nov 8, 2021
@ehsandeep ehsandeep deleted the adding-hosts-file-support branch November 8, 2021 07:59
@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to parse known hosts from system hosts file
3 participants