Find the answer to your Linux question:
Results 1 to 3 of 3
1) I was following a guide to setup bind again after I formatted to Ubuntu 10.04.2 LTS. Configuration I can get my domain example.com to resolve but I want "www.example.com" ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    84

    bind9: example.com works, www.example.com doesnt, and how to block url


    1)
    I was following a guide to setup bind again after I formatted to Ubuntu 10.04.2 LTS.
    Configuration

    I can get my domain example.com to resolve but I want "www.example.com" to resolve to the actual domain on the web.

    I don't have a webserver setup on my domain at the moment so I would rather it resolve properly.

    So "ping example.com" works and resolves to my local address but "ping www.example.com" gives "ping: unknown host www.example.com".

    Here is the file db.example.com,

    Code:
    ;
    ; BIND data file for example.com
    ;
    $TTL    604800
    @       IN      SOA     ns.example.com. root.example.com. (
                                  9         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
    @       IN      NS      ns.example.com.
    @       IN      A       10.11.12.1
    ;www    IN      A       10.11.12.1
    ns      IN      A       10.11.12.1
    I tried adding in a www entry but it only resolves to the same local ip as example.com so I commented it out.


    2)
    I am planning on adding all of the urls from the ad block site http://winhelp2002.mvps.org/hosts.txt to bind so as to block them on my network.

    So how would I add this list to bind?

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Quote Originally Posted by Shwick View Post
    I can get my domain example.com to resolve but I want www..example.com to resolve to the actual domain on the web.

    I don't have a webserver setup on my domain at the moment so I would rather it resolve properly.

    So "ping example.com" works and resolves to my local address but "ping www.example.com" gives "ping: unknown host www.example.com".
    Remove the ';' infornt of the www record and add the ip address of the server to it. But that is not going to work so simple as once the packet is received on the web server if it doesn't have a entery for www..example.com it's going to give you a 404 error or what ever the error is for 'page not found'.

    I tried adding in a www entry but it only resolves to the same local ip as example.com so I commented it out.
    See above as to why it still will not work.


    2)
    I am planning on adding all of the urls from the ad block site http://winhelp2002.mvps.org/hosts.txt to bind so as to block them on my network.

    So how would I add this list to bind?
    Yeah that isn't going to work either. You need to setup a zone file for every domain in order to do this and that is way too much time and effort.

    That link above is a host file just use that. Host files are great for this.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •