resolv-conf 0.5.0

The resolv.conf file parser
Documentation
use std::io::Read;
use std::fs::File;

extern crate resolv_conf;


fn main() {
    let mut buf = Vec::with_capacity(4096);
    let mut f = File::open("/etc/resolv.conf").unwrap();
    f.read_to_end(&mut buf).unwrap();
    let cfg = resolv_conf::Config::parse(&buf).unwrap();
    println!("---- Config -----\n{:#?}\n", cfg);
}