### Build and Run pkdns from Source Source: https://github.com/pubky/pkdns/blob/master/README.md Builds and runs the pkdns package using Cargo. Ensure the Rust toolchain is installed. ```bash cargo run --package=pkdns ``` -------------------------------- ### Clone pkdns Repository Source: https://github.com/pubky/pkdns/blob/master/README.md Clones the pkdns repository from GitHub. Requires Git to be installed. ```bash git clone https://github.com/pubky/pkdns.git ``` -------------------------------- ### Enable Verbose Logging Source: https://github.com/pubky/pkdns/blob/master/docs/logging.md Use the `--verbose` flag to make pkdns log all queries. This is the simplest way to get detailed output. ```bash pkdns --verbose ``` -------------------------------- ### Combine Module-Specific Log Levels Source: https://github.com/pubky/pkdns/blob/master/docs/logging.md Combine log level settings for multiple modules to get detailed logs from specific parts of the system. ```bash RUST_LOG=pkdns=trace,mainline=trace ``` ```bash RUST_LOG=pkdns=debug,pkarr=debug,mainline=debug ``` -------------------------------- ### pkdns Command Line Options Source: https://github.com/pubky/pkdns/blob/master/README.md Use these options to configure pkdns when running it from the command line. The default values are shown. ```bash Usage: pkdns [OPTIONS] Options: -f, --forward ICANN fallback DNS server. Format: IP:Port. [default: 8.8.8.8:53] -v, --verbose Show verbose output. [default: false] -c, --config The path to pkdns configuration file. This will override the pkdns-dir config path -p, --pkdns-dir The base directory that contains pkdns's data, configuration file, etc [default: ~/.pkdns] -h, --help Print help -V, --version Print version ``` -------------------------------- ### Navigate to pkdns Directory Source: https://github.com/pubky/pkdns/blob/master/README.md Changes the current directory to the cloned pkdns repository. This is a prerequisite for building. ```bash cd pkdns ``` -------------------------------- ### Publish DNS Records with pkdns-cli Source: https://github.com/pubky/pkdns/blob/master/cli/sample/README.md Use this command to publish DNS records from a seed file and a zone file to the mainline DHT. Note that pkdns caches DHT packets for at least 60 seconds. Run with `--max-ttl 0` to disable caching. ```bash $ ./pkdns-cli publish seed.txt pkarr.zone Packet 8qhdp5s8jjmxmqam3bpg9kzeg7x8teztuwrfgxw5ikn9z5bt15uy Name TTL Type Data @ 60 A 127.0.0.1 dynv4 60 A 213.55.243.129 dynv6 60 AAAA 2a04:ee41:0:819d:1905:9907:f695:41f3 text 60 TXT hero=satoshi2 Announce every 60min. Stop with Ctrl-C... 2024-08-05 14:30:03.612747 +02:00 Successfully announced. ``` -------------------------------- ### Verify DNS Records with nslookup Source: https://github.com/pubky/pkdns/blob/master/cli/sample/README.md Use nslookup to verify your published DNS records by querying a specific pkdns server. Replace the ID with your actual packet ID. ```bash nslookup 8qhdp5s8jjmxmqam3bpg9kzeg7x8teztuwrfgxw5ikn9z5bt15uy 34.65.109.99 ``` -------------------------------- ### Verify pkdns Server with nslookup Source: https://github.com/pubky/pkdns/blob/master/README.md Use nslookup to verify that your pkdns server is resolving pkdns domains. Replace PKDNS_SERVER_IP with your server's IP address. ```bash nslookup 7fmjpcuuzf54hw18bsgi3zihzyh4awseeuq5tmojefaezjbd64cy PKDNS_SERVER_IP ``` -------------------------------- ### Set Fallback DNS Server Source: https://github.com/pubky/pkdns/blob/master/README.md Configure a fallback DNS server for pkdns if it fails to resolve ICANN domains. Replace REGULAR_DNS_SERVER_IP with the desired IP address, or use 8.8.8.8 for Google DNS. ```bash pkdns -f REGULAR_DNS_SERVER_IP ``` ```bash pkdns -f 8.8.8.8 ``` -------------------------------- ### Set Module-Specific Log Level Source: https://github.com/pubky/pkdns/blob/master/docs/logging.md Configure log levels for individual modules like pkdns or mainline DHT. This allows fine-grained control over logging output. ```bash RUST_LOG=pkdns=trace ``` ```bash RUST_LOG=mainline=debug ``` -------------------------------- ### Verify pkdns Server with ICANN Domains Source: https://github.com/pubky/pkdns/blob/master/README.md Use nslookup to verify that your pkdns server is resolving regular ICANN domains. Replace PKDNS_SERVER_IP with your server's IP address. ```bash nslookup example.com PKDNS_SERVER_IP ``` -------------------------------- ### Generate a Seed File Source: https://github.com/pubky/pkdns/blob/master/cli/sample/README.md Generate a 64-character hex encoded seed for publishing records. This seed is used as the identifier for your records on the DHT. ```bash ./pkdns-cli generate > seed.txt ``` -------------------------------- ### Extract Tar File Source: https://github.com/pubky/pkdns/blob/master/README.md Extracts a downloaded tar.gz file. Ensure you have the correct tar file name. ```bash tar -xvf tarfile.tar.gz ``` -------------------------------- ### NGINX Configuration for PKDNS DoH Source: https://github.com/pubky/pkdns/blob/master/docs/dns-over-https.md This NGINX configuration forwards requests to the PKDNS DoH socket. Ensure PKDNS is configured to listen on http://127.0.0.1:3000. ```nginx location / { proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://127.0.0.1:3000; } ``` -------------------------------- ### Set Global Log Level Source: https://github.com/pubky/pkdns/blob/master/docs/logging.md Set the RUST_LOG environment variable to a specific log level (e.g., debug) to control the verbosity of all logs. ```bash RUST_LOG=debug ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.