1

Is there any way I can specify a custom resolv.conf file (instead of /etc/resolv.conf) in RedHat Linux, similar to specifying custom hosts file via export HOSTALIASES=~/my_hosts? I don't have root access to the server.

Background: I need my ldapsearch command and hosts command to use my custom resolv.conf file instead of the default /etc/resolv.conf file

OS version: Red Hat Enterprise Linux Server release 6.9 (Santiago)

penguin
  • 39
  • 7

1 Answers1

0

It's a path compiled into glibc, so your options are limited.
About the only solution I can think of (although I've never actually done this) would be to compile a custom resolver library to be used for your applications, and then run them with the LD_PRELOAD=/path/to/custom.resolver.library.so /path/to/your/app. You would need to know how to build a custom resolver library first, of course.

penguin
  • 39
  • 7
guzzijason
  • 1,410
  • 8
  • 18