In Ubuntu I'm trying to configure a DNS-server for a domain. I haven't tested it yet because I haven't got access to the virtual box yet. But I can feel that it contains problems. Can someone spot any obvious errors? I know it's hard without running a server test.

I have configured named.conf.local like this:

zone "craig.linuxcourse.tfe.ltu.se" {
type master;
    file "/etc/bind/db.craig.linuxcourse.tfe.ltu.se";

Now I'm trying to configure the zone file but I'm sort of confused what to change the localhost to for it to be able to connect.

I also want to add the following hosts:

  • ns1 (with a NS- and a A-record for the DNS-server)

  • www

  • ftp

  • 'student name' (this should be the name for the virtual server)

This is what I have changed so far:

; BIND data file for example.com
$TTL    604800
@       IN      SOA     craig.linuxcourse.tfe.ltu.se. root.linuxcourse.tfe.ltu.se. (
                          2         ; Serial
                     604800         ; Refresh
                      86400         ; Retry
                    2419200         ; Expire
                     604800 )       ; Negative Cache TTL
    IN      A
@       IN      NS      ns1.craig.linuxcourse.tfe.ltu.se.
@       IN      A       craig.linuxcourse.tfe.ltu.se
www     IN      A       www.craig.linuxcourse.tfe.ltu.se
ftp     IN      A       ftp.craig.linuxcourse.tfe.ltu.se
  • A records need an IP address, not another name. So you can't do @ IN A craig.example.com. but you can do @ IN A
    – roaima
    May 21, 2018 at 13:57
  • You have all sorts of issues. named-checkzone example.com /path/to/zonefile will check zone file syntax and tell you what is wrong. Or be lazy and use a zone file generator like zonefile.org
    – ivanivan
    May 21, 2018 at 16:20

2 Answers 2


Like the other person said A records require addresses. But you can use CNAMEs like I think you are trying in your example .

wwww   IN   A 
ftp    IN   CNAME  wwww

Thanks for all the answers. I have edited the configs after reading your comments. Does this look more OK?

; BIND data file for local loopback interface
$TTL    5D
@       IN      SOA     ns1.craig.linuxcourse.tfe.ltu.se. 
root.linuxcourse.tfe.ltu.se. (
                 2018052100         ; Serial
                     604800         ; Refresh
                      86400         ; Retry
                    2419200         ; Expire
                      10800 ); Negative Cache TTL
                IN      NS      ns1.craig.linuxcourse.tfe.ltu.se.

ns1             IN      A       xxx.239.163.100
www             IN      A       xxx.239.163.110
ftp             IN      A       xxx.239.163.120
craig           IN      A       xxx.239.163.130

And this is what the named.conf.local looks like:

zone    "craig.linuxcourse.tfe.ltu.se" in {
    allow-transfers { any; };
    file "/etc/bind/db.craig.linuxcourse.tfe.ltu.se";
    type master;
  • the line starting with ns1 should be ns1 IN A and not NS; we also nowadays use as somewhat de facto standard a Serial of YYMMDDnn as in 2018052100 for the first edit of the day. The max value allowed for the negative cache in SOA is 10800 May 21, 2018 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.