alex
alex

Reputation: 2243

Python Locust: how to use different DNS server?

I need locust to use a different DNS server - when resolving the URL? Is this possible?

class User(HttpUser):
    @task
    def get_data(self):
        headers = {'authToken': self.token,
                   'Content-Type': 'application/json'}

        res = self.client.get("/data", headers=headers, dns=8.8.8.8)

that dns = 8.8.8.8 doesn't exist but its the functionality I'd like.

nslookup has this functionality: nslookup google.com 8.8.8.8

Upvotes: 0

Views: 264

Answers (1)

Solowalker
Solowalker

Reputation: 2856

The Locust client inherits from Requests. Something like the answers to this question should work.

Python 'requests' library - define specific DNS?

Upvotes: 1

Related Questions