Blame
Date:
Sun Jan 29 05:00:28 2023 UTC
Message:
Daily backup
01
2023-01-22
jrmu
version=pmwiki-2.2.130 ordered=1 urlencoded=1
02
2023-01-22
jrmu
agent=w3m/0.5.3+git20210102
03
2023-01-22
jrmu
author=jrmu
04
2023-01-22
jrmu
charset=UTF-8
05
2023-01-22
jrmu
csum=
06
2023-01-22
jrmu
ctime=1627399082
07
2023-01-22
jrmu
host=38.87.162.8
08
2023-01-22
jrmu
name=Host.Usage
09
2023-01-22
jrmu
rev=3
10
2023-01-22
jrmu
targets=Dns.Overview,DNS.SPF,Unbound.Configure
11
2023-01-22
jrmu
text=(:title Using host:)%0a%0a!! Overview%0a%0a[[https://man.openbsd.org/host|host]] is a useful utility for performing [[dns/overview|DNS]] lookup.%0a%0a!! Examples%0a%0a!!! DNS Lookup%0a%0aSuppose you want to find the IP address of example.com:%0a%0a[@%0a$ host example.com%0aexample.com has address 192.168.1.1%0aexample.com has IPv6 address 2001:db8::%0aexample.com mail is handled by 10 example.com.%0a@]%0a%0aNot only will it provide the IPv4 address, it also gives you the IPv6 address and mail servers for a domain.%0a%0a!!! Reverse DNS (rDNS) Lookup%0a%0aIf you know the IPv4/IPv6 address but don't know the domain name associated with it, you can perform rDNS lookup:%0a%0a[@%0a$ host 192.168.1.1%0a1.1.168.192.in-addr.arpa domain name pointer example.com.%0a@]%0a%0aNotice that when you perform reverse DNS lookup, the four numbers get reversed in the in-addr.arpa domain -- the last number shows up first, and the first number shows up last. This happens because in an IP address, the least significant number is last; whereas in DNS, the least significant domain shows up first.%0a%0a[@%0a$ host 2001:db8::%0a0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa domain name pointer ircnow.org.%0a@]%0a%0aThe same happens for IPv6; the last digit shows up first, and the first digit shows up last.%0a%0a!! Query types%0a%0ahost can show a specific query type with the @@-t@@ option. Query types include NS, MX, and TXT.%0a%0aFor example, to show all the nameservers of example.com, type:%0a%0a[@%0a$ host -t ns example.com%0aexample.com name server ns1.example.com.%0aexample.com name server ns2.example.com.%0a@]%0a%0aTo show the mail servers, type:%0a%0a[@%0a$ host -t mx example.com%0aexample.com mail is handled by 10 mail.example.com.%0a@]%0a%0aTo show the TXT records, type:%0a%0a[@%0a$ host -t txt example.com%0aexample.com descriptive text "v=spf1 a mx ip4:192.168.1.1 -all"%0a@]%0a%0aHere, we see the TXT record is used to provide [[DNS/SPF|SPF]] information for mail servers.%0a%0a!! Troubleshooting%0a%0aUsing host, you can test if your DNS records have been set properly. If you just added a DNS record, use host on that name to see if it resolves properly.%0a%0aIf your records have changed, make sure to flush your old DNS cache before running host. By default, host uses the nameservers you put in [[https://man.openbsd.org/resolv.conf|/etc/resolv.conf]]. For example:%0a%0a[@%0anameserver 8.8.8.8%0alookup file bind%0a@]%0a%0aresolv.conf tells your server to ask 8.8.8.8 (Google) for domain name lookup.%0a%0aIt's recommended to run your own local caching DNS server with [[unbound/configure|unbound]] instead of using Google or the nameserver provided by your ISP. By running a local caching DNS server, you have more freedom to pick nameservers, which can help prevent censorship and privacy issues.%0a%0aIf you decide to use unbound, you will want to resolv.conf to point to localhost:%0a%0a[@%0anameserver 127.0.0.1%0alookup file bind%0a@]%0a%0aThen, if you have updated your DNS records, you can simply restart the nameserver to flush the cache of DNS records:%0a%0a[@%0a$ doas rcctl restart unbound%0a@]%0a%0aThen, run host again.%0a
12
2023-01-22
jrmu
time=1627437446
13
2023-01-22
jrmu
title=Using host
14
2023-01-22
jrmu
author:1627437446=jrmu
15
2023-01-22
jrmu
diff:1627437446:1627400690:=39,66d38%0a%3c %0a%3c !! Query types%0a%3c %0a%3c host can show a specific query type with the @@-t@@ option. Query types include NS, MX, and TXT.%0a%3c %0a%3c For example, to show all the nameservers of example.com, type:%0a%3c %0a%3c [@%0a%3c $ host -t ns example.com%0a%3c example.com name server ns1.example.com.%0a%3c example.com name server ns2.example.com.%0a%3c @]%0a%3c %0a%3c To show the mail servers, type:%0a%3c %0a%3c [@%0a%3c $ host -t mx example.com%0a%3c example.com mail is handled by 10 mail.example.com.%0a%3c @]%0a%3c %0a%3c To show the TXT records, type:%0a%3c %0a%3c [@%0a%3c $ host -t txt example.com%0a%3c example.com descriptive text "v=spf1 a mx ip4:192.168.1.1 -all"%0a%3c @]%0a%3c %0a%3c Here, we see the TXT record is used to provide [[DNS/SPF|SPF]] information for mail servers.%0a
16
2023-01-22
jrmu
host:1627437446=38.87.162.8
17
2023-01-22
jrmu
author:1627400690=jrmu
18
2023-01-22
jrmu
diff:1627400690:1627399082:=5,68c5%0a%3c [[https://man.openbsd.org/host|host]] is a useful utility for performing [[dns/overview|DNS]] lookup.%0a%3c %0a%3c !! Examples%0a%3c %0a%3c !!! DNS Lookup%0a%3c %0a%3c Suppose you want to find the IP address of example.com:%0a%3c %0a%3c [@%0a%3c $ host example.com%0a%3c example.com has address 192.168.1.1%0a%3c example.com has IPv6 address 2001:db8::%0a%3c example.com mail is handled by 10 example.com.%0a%3c @]%0a%3c %0a%3c Not only will it provide the IPv4 address, it also gives you the IPv6 address and mail servers for a domain.%0a%3c %0a%3c !!! Reverse DNS (rDNS) Lookup%0a%3c %0a%3c If you know the IPv4/IPv6 address but don't know the domain name associated with it, you can perform rDNS lookup:%0a%3c %0a%3c [@%0a%3c $ host 192.168.1.1%0a%3c 1.1.168.192.in-addr.arpa domain name pointer example.com.%0a%3c @]%0a%3c %0a%3c Notice that when you perform reverse DNS lookup, the four numbers get reversed in the in-addr.arpa domain -- the last number shows up first, and the first number shows up last. This happens because in an IP address, the least significant number is last; whereas in DNS, the least significant domain shows up first.%0a%3c %0a%3c [@%0a%3c $ host 2001:db8::%0a%3c 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa domain name pointer ircnow.org.%0a%3c @]%0a%3c %0a%3c The same happens for IPv6; the last digit shows up first, and the first digit shows up last.%0a%3c %0a%3c !! Troubleshooting%0a%3c %0a%3c Using host, you can test if your DNS records have been set properly. If you just added a DNS record, use host on that name to see if it resolves properly.%0a%3c %0a%3c If your records have changed, make sure to flush your old DNS cache before running host. By default, host uses the nameservers you put in [[https://man.openbsd.org/resolv.conf|/etc/resolv.conf]]. For example:%0a%3c %0a%3c [@%0a%3c nameserver 8.8.8.8%0a%3c lookup file bind%0a%3c @]%0a%3c %0a%3c resolv.conf tells your server to ask 8.8.8.8 (Google) for domain name lookup.%0a%3c %0a%3c It's recommended to run your own local caching DNS server with [[unbound/configure|unbound]] instead of using Google or the nameserver provided by your ISP. By running a local caching DNS server, you have more freedom to pick nameservers, which can help prevent censorship and privacy issues.%0a%3c %0a%3c If you decide to use unbound, you will want to resolv.conf to point to localhost:%0a%3c %0a%3c [@%0a%3c nameserver 127.0.0.1%0a%3c lookup file bind%0a%3c @]%0a%3c %0a%3c Then, if you have updated your DNS records, you can simply restart the nameserver to flush the cache of DNS records:%0a%3c %0a%3c [@%0a%3c $ doas rcctl restart unbound%0a%3c @]%0a%3c %0a%3c Then, run host again.%0a---%0a> host is a useful utility for performing [[dns/overview|DNS]] lookup.%0a
19
2023-01-22
jrmu
host:1627400690=38.87.162.8
20
2023-01-22
jrmu
author:1627399082=jrmu
21
2023-01-22
jrmu
diff:1627399082:1627399082:=1,5d0%0a%3c (:title Using host:)%0a%3c %0a%3c !! Overview%0a%3c %0a%3c host is a useful utility for performing [[dns/overview|DNS]] lookup.%0a
22
2023-01-22
jrmu
host:1627399082=38.87.162.8
IRCNow