# How to get the Node name using attributes in chef

**URL:** <https://discourse.chef.io/t/how-to-get-the-node-name-using-attributes-in-chef/8804>\
**Category:** Chef Infra (archive)\
**Created:** [June 28, 2016, 7:20am UTC](https://discourse.chef.io/t/how-to-get-the-node-name-using-attributes-in-chef/8804 "2016-06-28T07:20:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramaduraiu](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@ramaduraiu](https://discourse.chef.io/u/ramaduraiu)\
**Post date:** [June 28, 2016, 7:20am UTC](https://discourse.chef.io/t/how-to-get-the-node-name-using-attributes-in-chef/8804/1 "2016-06-28T07:20:32Z")

</div>

HI,

I want to get the node name as attributes which is in chef server.

At the time of bootstrapping the node I have used node name as TestNode. So I need that node name as attributes in my recipe.

Can anyone tell me how to get that .

Regards,  
Ramadurai.

---

<div class="post-metadata">

**Author:** ![chris\_sullivan](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@chris\_sullivan](https://discourse.chef.io/u/chris_sullivan)\
**Post date:** [June 28, 2016, 8:48am UTC](https://discourse.chef.io/t/how-to-get-the-node-name-using-attributes-in-chef/8804/2 "2016-06-28T08:48:54Z")

</div>

You should be able to get the name from the node object

```auto
node.name

```

---

<div class="post-metadata">

**Author:** ![ramaduraiu](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@ramaduraiu](https://discourse.chef.io/u/ramaduraiu)\
**Post date:** [June 28, 2016, 11:34am UTC](https://discourse.chef.io/t/how-to-get-the-node-name-using-attributes-in-chef/8804/3 "2016-06-28T11:34:27Z")

</div>

Thanks Chris sullivan. I got the value .
