Skip to content

Commit

Permalink
Complete change DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohuva13 committed Jul 27, 2023
1 parent 4d48ff1 commit 8195a7b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ fn main() {
file.write_all(format!("nameserver {}\n", dns.3).as_bytes()).expect("write failed");


// change dns
let mut cmd = std::process::Command::new("cp");
cmd.arg("-r");
cmd.arg("./choosen_dns.txt");
cmd.arg("/etc/resolv.conf");
let output = cmd.output().expect("failed to execute process");
println!("{}", String::from_utf8_lossy(&output.stdout));
println!("{}", String::from_utf8_lossy(&output.stderr));
println!("DNS changed to {}", dns.1);
println!("Done!");
println!("\n GitHub: Mohuva13");


}

0 comments on commit 8195a7b

Please sign in to comment.