lsb_release -d # get Linux distro and version
cat /etc/centos-release
# ubuntu
sudo /etc/init.d/bind9 {start | stop | restart}
sudo -u bind rndc status
For years it’s been simple to set up DNS on a Linux machine. Just add a couple of entries to /etc/resolv.conf and you’re done. | |
# Use Google's public DNS servers. | |
nameserver 8.8.4.4 | |
nameserver 8.8.8.8 | |
But things change and now it’s not that simple. If you now edit /etc/resolv.conf on Ubuntu you’ll find that the edits are ephemeral. If you restart (or even hibernate) your machine then they’ll be overwritten by default content. | |
nameserver 127.0.0.53 | |
search Home | |
This is pretty simple to fix though. |
Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.
Sample output:
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED
{ | |
"a": 1, | |
"[[Prototype]]": { | |
"constructor: class A {}": { | |
"prototype": { | |
"constructor: class A {}": {}, | |
"getA: f getA() {}": {}, | |
"[[Prototype]]": {} | |
}, | |
"name": "A", |
/* Control Flow 1 - Repetitive Serial Execution of an Asynchronous Function | |
* | |
* Based on: | |
* - http://book.mixu.net/node/ch7.html | |
* - https://github.com/mixu | |
* | |
* Revised to use "typeof(first_item) != 'undefined'" based upon comments from 'Israel' | |
* | |
* Characteristics: | |
* - Flow control construct 'series' is recursive |
/* This addresses a problem with the 'net-watcher.js' example in Jim Wilson's | |
* "Node.js The Right Way" book when running his 'net-watcher.js' example under | |
* Ubuntu 14.04 (and probably some other *nixs too). | |
*/ | |
'use strict'; | |
const | |
fs = require('fs'), | |
net = require('net'), |
// set the site we are modifying | |
const site = 'www.example.com'; | |
// do this on a fetch | |
addEventListener('fetch', event => { | |
const request = event.request | |
const url = new URL(request.url) | |
event.respondWith(handleRequest(request)) | |
}); |
# View device IP Address(es) | |
ip -o address show [interface] | awk '{print $4}' # Prints the IP address(es) of a single interface | |
ip address # Displays all interfaces | |
ifconfig # (deprecated) | |
hostname -I # Displays only IP addresses | |
# DNS name and resolution | |
host | |
dig | |
/etc/hosts # Add manual DNS record to hostname mappings (normally checked before configured DNS server(s)) |
ifconfig
- ifconfig (interface configurator) command is use to initialize an interface, assign IP Address to interface and enable or disable interface on demand. With this command you can view IP Address and Hardware / MAC address assign to interface and also MTU (Maximum transmission unit) size.
ifconfig -a
-a
options will display all available interface details if it is disable also.ifconfig -v
ifconfig -s