Operating System - HP-UX
1821639 Members
3459 Online
109633 Solutions
New Discussion юеВ

comments in /etc/hosts and /etc/named.data

 
SOLVED
Go to solution
Fred Martin_1
Valued Contributor

comments in /etc/hosts and /etc/named.data

I'd like to add comments to /etc/hosts such as:

209.90.236.66 wally mail # comment
209.90.236.67 frank # comment

Is there any problem with that?

And, how would I do a similar thing to the db files in /etc/named.data for DNS?
fmartin@applicatorssales.com
12 REPLIES 12
Pete Randall
Outstanding Contributor

Re: comments in /etc/hosts and /etc/named.data

Fred,

I can tell you for a fact that there's no problem with the /etc/hosts comments because I do exactly the same thing.

As for /etc/named.data, I'm not sure but I would think it should be OK.

https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c01440077

https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c01927913
Pete


Pete
Hai Nguyen_1
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

Fred,

It is 100% safe to add comments that way in /etc/hosts. As for files in /etc/named.data, a comment line begins with ";" as the very fisrt character on the line.

Hai
Helen French
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

No problem in doing that with /etc/hosts file. You can add comments at the end of the line.
Life is a promise, fulfill it!
Fred Martin_1
Valued Contributor

Re: comments in /etc/hosts and /etc/named.data

I assume then that for the db files, I can not do this:

myserver IN A 209.90.236.66 ; comment

If anyone has done this with success let me know...

Fred
fmartin@applicatorssales.com
Michael Steele_2
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

Try a ; (* semi colon *) in the db.* files. (* which are automatically created. *)
Support Fatherhood - Stop Family Law
Helen French
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

Forgot to add: in DNS, you can add comments with ";". Even in this case, you can add comments at the start or in the middle of the line.
Life is a promise, fulfill it!
Michael Steele_2
Honored Contributor
Uday_S_Ankolekar
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

For DNS in named.data directory you can use some thing like this..
for example in db.doamin file
hostname IN A ip-address
hostname IN TXT "comments"

In /etc/hosts file you can use comments the way you mentioned without any problem

-USA..
Good Luck..
Helen French
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

For the last question about comments adding with DNS, Yes, you can do that. Check here for clarification:

http://www.docs.hp.com/hpux/onlinedocs/B2355-90147/B2355-90147.html

You will lot of examples on this document (for eg: Check "Configuring and Administering BIND ..." then "Configuring primary master name server")

Life is a promise, fulfill it!
Helen French
Honored Contributor

Re: comments in /etc/hosts and /etc/named.data

For the last question about comments adding with DNS, Yes, you can do that. Check here for clarification:

http://www.docs.hp.com/hpux/onlinedocs/B2355-90147/B2355-90147.html

You will find lot of examples on this document (for eg: Check "Configuring and Administering BIND ..." then "Configuring primary master name server")

Life is a promise, fulfill it!
Hai Nguyen_1
Honored Contributor
Solution

Re: comments in /etc/hosts and /etc/named.data

Fred,

I have just looked into the files in /etc/named.data and found that in addition to creating a comment at the beginnig of a line, you can also add it to the end of a line. Look at /etc/named.data/boot.cacheonly as an example:
;
; type domain source file
;


directory /tmp/named.data ; running directory for named

primary 0.0.127.IN-ADDR.ARPA db.127.0.0
cache . db.cache


Hai
Fred Martin_1
Valued Contributor

Re: comments in /etc/hosts and /etc/named.data

thanks all
Fred
fmartin@applicatorssales.com