Skip to content

dial tcp "no such host" error on a specific case #26

@aroly

Description

@aroly

Hello,

I'm currently facing a weird issue with one specific case when using the lib to send "malformed" HTTP request. My idea is to send a request to a specific HTTP(S) server, but with a different "Host" header in the HTTP request, to test for Host header attacks. Most of the time, this works well, but I sometimes receive this issue when running the code.

go run test.go

Target server: https://foo.com
Hostname: bar.com
Error while requesting https://foo.com with bar.com
2021/10/15 11:03:52 Error: dial tcp: lookup bar.com on 192.168.1.1:53: no such host
exit status 1

In this case, the hostname I want to use is not known by the DNS, but this should not be a problem. And it woks perfectly in other cases. I attached the code I use as txt (it's crappy, but it's the first time I write something in Go :)).

test.go.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: QuestionA query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions