Bind zone configuration files


















Above command will show nothing if there is no error found in the configuration file. In case of any error will displayed as output. If you are using an older version of the bind, you can have also checked the configuration using below command. Is there a Windows port of this? Or even an online version? Primary Master Server BIND9 can be used to serve DNS records groups of records are referred to as zones for a registered domain name or an imaginary one but only if used on a restricted network.

Secondary Master Server A secondary master DNS server is used to complement a primary master DNS server by serving a copy of the zone s configured on the primary server. Secondary servers are recommended in larger setups. If you intend to serve a registered domain name they ensure that your DNS zone is still available even if your primary server is not online. All that is required is simply combining the different configuration examples.

These are effectively the same as Primary and Secondary DNS servers, but with a slight organizational difference. A is the Primary, B and C are secondaries. It's still a secondary, but it's not going to be asked about the zone you are serving to the internet from A and B If you configure your registered domain to use B and C as your domain's DNS servers, then A is a stealth primary.

Any additional records or edits to the zone are done on A, but computers on the internet will only ever ask B and C about the zone. Address Records The most commonly used type of record. This record maps an IP Address to a hostname. But it doubles the number of requests made to the nameserver, thus making it an inefficient way to do so. Multiple MX records can exist if multiple mail servers are responsible for that domain. IN MX 10 mail.

This is where Primary and Secondary servers are defined. Stealth servers are intentionally omitted. IN NS ns. This is due to the server caching the query. Simply replace example. Change Also, create an A record for ns. If you make multiple changes before restarting BIND9, simply increment the serial once.

Spammers suck. A records are the part of a zone file that actually do what most people think of DNS as doing—they translate a hostname to a bare IPv4 address. In this case, this is a sample file only—and our A record for example. In real life, of course, you'd put in the IP address of the server you expected to answer when you ping example. In this simple zone file, we only have a single A record for example.

This TXT , or text record, is still in the head section of our zone file, under the hostname example. So its scope is the entire example. You can put just about anything in a TXT record; this specific one is an SPF record, formatted to give mailservers information about what machines are authorized to emit mail on behalf of example.

In this case, we're saying that we're using the SPF1 version of formatting. We then inform anyone querying this record that any valid A record for example. Now that we've defined everything we need to for the domain, we can start adding records for any hostnames and subdomains beneath example. Again, notice that final terminating dot—if you forget it, things are going to get really strange and you'll tear your hair out wondering why none of your records resolve properly!

We see A records here for ns1 , ns2 , and mail. These A records work the same way that the A record for the domain itself did—we are telling BIND what IP address to resolve requests for that hostname to. We also have an AAAA record for mail. Once again, we've chosen in our example to use a localhost address.

You'll need to be familiar with AAAA records if you expect to set up your own mailserver—Google stopped being willing to talk to mailservers without fully working IPv6 DNS a few years ago! CNAME records are handy, but they're a bit funky. If you try to set MX mail. CNAME example. If you have access to Linux, Mac, or Windows Subsystem for Linux, by far the best command line tool is dig.

Using dig is as simple as specifying a server to query, the record type you want to look for, and the FQDN it should be associated with. In the example above, we asked the DNS server at In addition to the answers we wanted, we got a ton of diagnostic information—the DNS server we queried did not return an ERROR when queried, it says it is authoritative for the domain in question, and so forth. If you don't have access to dig , you can generally get by with nslookup.

Most commonly, this is a semi-cursed workaround for users sitting at a Windows box without access to Windows Subsystem for Linux, cygwin, or some other way to gain access to more advanced tools than the Windows CLI provides. Here's a sample session:. By setting server You don't have to specify this; if you don't, nslookup will use whatever the default DNS resolver on your machine would. After optionally setting the server , you can just type a bare hostname into nslookup 's interactive prompt, and it will return any A or AAAA records it can find for that hostname.



0コメント

  • 1000 / 1000