Jeremy Gwa
Jeremy Gwa

Reputation: 2413

opendns and perl lwp::simple get

I am trying to filter web content that is accessed programmatically, lets say through lwp::simple or sockets.

I do not have any control over the server configuration, eg. dns settings

How will I be able to use opendns, with these restrictions.

is there per-request dns?

I am not that familiar with this topic, and I greatly appreciate your help.

Upvotes: 0

Views: 126

Answers (1)

daxim
daxim

Reputation: 39158

LWP/Perl sockets use the operating system's resolver only. You need to set up a separate forwarder (e.g. dnsmasq) somewhere that can be configured to resolve certain hostname differently. Then either:

  • subclass LWP to use the external forwarder or
  • get permission to point the OS resolver there or
  • write something in C that hi-jacks the getnameinfo(3)/gethostbyaddr(3) and related system calls, then install this as preload hack.

Upvotes: 1

Related Questions