# DNS Domain and Workgroup



## Roneros (Mar 15, 2010)

Hello!

I'm trying to set squid get the names of pcs thats accessing the net. I configured a new logformat with "%>A" parameter and the result is ok for pcs that's at domain, but the pcs at workgroups, the result is only the ip.
I configured the squid.conf with the ip of Domain Server, the auto DNS configured at DHCP.

```
dns_nameservers xx.xx.xx.xx
```

I configured the /etc/hosts this way:


```
127.0.0.1      localhost localhost.domain
xx.xx.xx.xx    FreeBSD.domain FreeBSD
xx.xx.xx.xx    DNSServerName
xx.xx.xx.xx    DNSServerName.domain
```

I configured /etc/resolv.conf this way:


```
domain         FreeBSDDomain
search         DNSServerName.domain
nameserver     xx.xx.xx.xx #(ip of domain server)
```

What I need to configure more for I can ping the pcs out of the domain? Thanks a lot!


----------



## Roneros (Mar 15, 2010)

Just adding... "What I need to configure more for I can ping the pcs out of the domain?"

...ping _BY NAME _the pcs out of the domain.


----------



## J65nko (Mar 15, 2010)

A hostname has at least 3 parts:


 the top level domain : e.g.'org'
the second level domain: e.g. freebsd
the host name : e.g. forums

If you want to be able to ping the hosts by name you have to set up a local DNS server which can resolve the local hostnames to IP address (forward lookup).

On my private network (192.168.222.0/24) which has the local domain name of 'utp.xnet' I configured a local nameserver.

```
$ dig hydra.utp.xnet  

; <<>> DiG 9.4.2-P2 <<>> hydra.utp.xnet
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28850
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;hydra.utp.xnet.                        IN      A

;; ANSWER SECTION:
hydra.utp.xnet.         604766  IN      A       192.168.222.39

;; Query time: 1 msec
;; SERVER: 192.168.222.25#53(192.168.222.25)
;; WHEN: Mon Mar 15 23:43:06 2010
;; MSG SIZE  rcvd: 48
```


----------



## Roneros (Mar 16, 2010)

Ok J, I'll configure DNS Server Service and post reply soon. Thks for help.


----------



## Roneros (Mar 16, 2010)

Nice one! DNS Configured. But there's something strange, when I 'dig' the host, I get the answer and when I ping the host, I got a error:


```
[FreeBSDT# dig juridico

; <<>> DiG 9.6.1-P1 <<>> juridico
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 47593
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;juridico.                      IN      A

;; AUTHORITY SECTION:
.                       10229   IN      SOA     A.ROOT-SERVERS.NET. NSTLD.VERISIGN-GRS.COM. 2010031600 1800 900 604800 86400

;; Query time: 6 msec
;; SERVER: 10.12.27.250#53(10.12.27.250)
;; WHEN: Tue Mar 16 09:57:57 2010
;; MSG SIZE  rcvd: 101

FreeBSDT# ping juridico
ping: cannot resolve juridico: Unknown host
```

And the error is really _'cannot resolve'_. Every help is welcome. Tks!


----------



## DutchDaemon (Mar 16, 2010)

Your dig command doesn't supply a good answer: *NXDOMAIN*. The host does not exist. Try with a fully-qualified domain name, i.e. juridico.yourdomain.com.


----------



## Roneros (Mar 16, 2010)

Ok, juridico is a pc outside my domain, its on a workgroup. If I ping with juridico.workgroup the answer is the same, cannot resolve juridico.workgroup: Unknown host. Tks for reply.


----------



## Roneros (Mar 16, 2010)

Some progress... Somes typos at dns configuration...

Now with a dig on a machine inside win domain:


```
; <<>> DiG 9.6.1-P1 <<>> mypc.mydomain.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4040
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 13, ADDITIONAL: 13

;; QUESTION SECTION:
;mypc.mydomain.local. IN        A

;; ANSWER SECTION:
mypc.mydomain.local. 1145 IN A  xx.xx.xx.xxx

;; AUTHORITY SECTION:
.                       72716   IN      NS      i.root-servers.net.
.                       72716   IN      NS      d.root-servers.net.
.                       72716   IN      NS      m.root-servers.net.
.                       72716   IN      NS      c.root-servers.net.
.                       72716   IN      NS      g.root-servers.net.
.                       72716   IN      NS      j.root-servers.net.
.                       72716   IN      NS      f.root-servers.net.
.                       72716   IN      NS      b.root-servers.net.
.                       72716   IN      NS      l.root-servers.net.
.                       72716   IN      NS      h.root-servers.net.
.                       72716   IN      NS      e.root-servers.net.
.                       72716   IN      NS      k.root-servers.net.
.                       72716   IN      NS      a.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net.     72716   IN      A       198.41.0.4
b.root-servers.net.     72716   IN      A       192.228.79.201
c.root-servers.net.     72716   IN      A       192.33.4.12
d.root-servers.net.     72716   IN      A       128.8.10.90
e.root-servers.net.     72716   IN      A       192.203.230.10
f.root-servers.net.     72716   IN      A       192.5.5.241
g.root-servers.net.     72716   IN      A       192.112.36.4
h.root-servers.net.     72716   IN      A       128.63.2.53
i.root-servers.net.     72716   IN      A       192.36.148.17
j.root-servers.net.     72716   IN      A       192.58.128.30
k.root-servers.net.     72716   IN      A       193.0.14.129
l.root-servers.net.     72716   IN      A       199.7.83.42
m.root-servers.net.     72716   IN      A       202.12.27.33

;; Query time: 10 msec
;; SERVER: xx.xx.xxx.xxx#53(xx.xx.xx.xxx)
;; WHEN: Tue Mar 16 14:17:50 2010
;; MSG SIZE  rcvd: 504
```

But when trying to ping the pc outside win domain, i got a 'cannot resolve', if I dig, NXDOMAIN, like before. All tips are welcome!


----------



## J65nko (Mar 16, 2010)

See http://www.daemonforums.org/showthread.php?t=4073 for a BIND configuration example for a local domain.


----------

