Namespace src/Dns

src/Dns

Overview

Directory src/Dns

file source src/Dns/addHost.sh

Dns::addHost

Featuring Retry::default 1 Warning(s)

add the line ip hostname at the end of /etc/hosts only if hostname does not exists yet in this file if wsl do the same in ${BASE_MNT_C}/Windows/System32/drivers/etc/hosts

Arguments
  • $1 hostName:String
  • $2 (ip:String): optional, default value: 127.0.0.1
Environment variables
  • BASE_MNT_C (String):
  • SUDO (String): allows to use custom sudo prefix command
Output on stderr
  • diagnostics information is displayed
Requires
  • Git::requireGitCommand
  • Linux::requireSudoCommand
Features
  • Retry::default
Warnings
  • files are backup before being updated

src/Dns/checkHostname.sh

file source src/Dns/checkHostname.sh

Dns::checkHostname

try to ping the dns

Arguments
  • $1 (host:String): is the dns hostname
Exit codes
  • 1: if host arg empty
  • 2: if ping host failed
  • 3: if ip is not bound to local ip address
  • 4: if ifconfig result is empty

src/Dns/pingHost.sh

file source src/Dns/pingHost.sh

Dns::pingHost

try to ping the given hostname

Arguments
  • $1 (host:String): hostname
Exit codes
  • 1: if hostname not pinged
Output on stderr
  • diagnostics information is displayed
Or, if you want, you can alternatively use the GitHub discussion Q&A for feedback and questions.