network manager - using a static "fallback /etc/hosts" if all other DNS options failed - Ask Ubuntu


if understand /etc/nsswitch.conf correctly, configuration

hosts:          files mdns4_minimal [notfound=return] dns 

results in interpreting /etc/hosts, mdns , "regular" dns servers.

now love have option set static fallback definitions in case previous resolving options failed.

switching dns , files bad idea because call dns servers everytime.

so i'm looking solution work in case dns server failed (and there no match in /etc/hosts obviously).

if solution result in file manageable per user perfect.

you can't, @ least nss (name service switch) implemetation of glibc.

you can use action service (like mdns4_minimal using [notfound=return] in example). it's of form:

[status=action] 

with preceding ! negate status.

the status can 1 of following four:

  • success
  • notfound
  • unavail
  • tryagain

and action can 1 of following two:

  • return
  • continue

here return return result without looking further lookup functions, , continue continue further. there no way mention file fallback.

you looking like:

hosts:   files mdns4_minimal [notfound=return] dns [notfound=/read/for/this/file] 

which not possible.

in nutshell, looking non-existent action of nsswitch.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User